I am trying to send a POST HTTP request with Content-Type=multipart/form-data and I keep getting this error response: (status code: HTTP/1.1 400 Bad Request), returned VT_BSTR : {"errors": [{"message": "Multipart Request should be correctly formatted (1=name, 2=key)"}]}.
I have added screenshots from what the request payload and request headers look like when ran from swagger editor, screenshot of the HTTP session i have defined in the protocol.xml, and a screenshot of the of the request being logged by the element. Does anyone know what the issue could be?
Hi Julian,
I believe the boundary in your body is wrong. Comparing with this page: Multipart Requests (swagger.io) you can see that the boundary is prefixed with two dashes every time it is used, and suffixed with another two dashes at the end.
Counting the dashes in your header definition, there seem to be 29, and your body contains 29 rather than 31 dashes.
I made a protocol for a similar question here: https://github.com/FlorisCO/Dojo-HttpPostCsv/blob/RC/protocol.xml
Hi Julian,
As an extra side note, you should let DataMiner add and calculate the Content-Length header instead of hard-coding it in the connector.
Hi Floris,
Changing the dashes to two worked. Thank you for your help.