Support Article
Multipart form data for REST Connect invalid Content Type
SA-55395
Summary
Unable to set content type for JSON in a multipart form-data for REST Connect.
Error Messages
{"error":{"message":"Invalid content-type: multipart/form-data; boundary=VSF4wPzjjM-yWfimCm8EBC7vZEi7zw3PUP application/json is expected","type":"XX.XXX.XXX.InvalidInputException"}}
Steps to Reproduce
- Create a REST Connect rule.
- Use pyRequestAttachmentPage page to add a binary file to the request.
- Add a JSON request mapping from a Clipboard page in the same rule.
- Use REST Connect method to invoke the Rest Connection. On the TCP dump, the generated request has the Content-Type as 'text or plain' instead of 'application or JSON'.
Root Cause
A defect or configuration issue in the operating environment.
Resolution
Set the type of the image as "image/"+.pyFileType in the pyRequestAttachmentPage.
Using pyFileType, only sends the extension.
For example, png
Set as: type=Image/.png
Published September 6, 2018 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.