3

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
)
3
  • What error are you receiving? Commented Nov 3, 2017 at 12:37
  • Error 500 Maybe this error is made by server?
    – MrViSiOn
    Commented Nov 3, 2017 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 Commented Nov 3, 2017 at 13:19

1 Answer 1

2

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .