2

How could I post data to a url with Content-Type: multipart/form-data

I doing this, but it reports error to me:

SET @httpPostCallStatus = HTTPPost2(
    "https://url-post-data",
    "multipart/form-data",
    "code=CODE_ALL_ABSOLUTE&amount=49&type=absolute&duration=24&minPurchaseAmount=49&country=ES&userId=2439630&uses=1&autoassign=1&platform=ALL",
    false,
    @httpPost2CallStatus,
    @httpPost2Response
)
  • What error are you receiving? – Gortonington Nov 3 '17 at 12:37
  • Error 500 Maybe this error is made by server? – MrViSiOn Nov 3 '17 at 12:51
  • Yes, that sounds like it is not an issue with the function, but instead something either with the URL you are posting to, settings on receiving server to receive data, or the data you are posting is incorrectly formatted – Gortonington Nov 3 '17 at 13:19
1

You will need to use the Content-Type "application/x-www-form-urlencoded" instead of "multipart/form-data".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.