Posted: 22 May 2017 1:48 EDT Last activity: 8 Jun 2017 0:49 EDT
How to pass a file and metadata as form-data in Connect-REST post method body
We are on pega 6.3Sp1 and we have a requirement to connect to an API through Connect-REST post method.
For this we need to pass file and some metadata in body of the request.I am able to call the service and perform functionality using Postman(attached postman configuration)
As suggested in one of the article in PDN(https://pdn.pega.com/support-articles/unable-send-attachment-connect-rest),we tried to set required properties on pyRequestAttachmentPage and for meta data i am setting required data to one property and sending it in the request through body of the connect-Rest rule(attached PRPC Configuration).But i am getting error in response saying "Current Request is not a multipart request".
Please advise me how i can send both attachment and metadata in request.
It is likely you'll want to implement the Example 2 from below.
------------------ troubleshooting details from SR that led to PDN article posted above ------------------------
Is it a simple POST request with the Content-Type set according to the binary content, say, application/pdf if it is PDF content or is it part of a "multipart" request with one part being the binary content?