Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

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

  1. Create a REST Connect rule.
  2. Use pyRequestAttachmentPage page to add a binary file to the request.
  3. Add a JSON request mapping from a Clipboard page in the same rule.
  4. 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

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us