Support Article
Newline before boundary param for MultiPart request
SA-60445
Summary
The application generated Connect-REST multipart request adds a newline character (\r\n) before the boundary parameter in the multipart request header.
Below is the multipart request header generated in Pega 7.2.2 for the boundary:
POST /prweb/PRRestService/RestBoundarypkg/restboundaryapi/Restboundaryapi HTTP/1.1
Content-Type: multipart/form-data;
boundary="----=_Part_1_2088764079.1529702388343"
Content-Length: 633066
Host: your_host:9190
Connection: Keep-Alive
The multipart request header for the boundary must be as below:
POST /prweb/PRRestService/RestBoundarypkg/restboundaryapi/Restboundaryapi HTTP/1.1
Content-Type: multipart/form-data; boundary="----=_Part_1_2088764079.1529702388343"
Content-Length: 633066
Host: your_host:9190
Connection: Keep-Alive
Due to the newline character before the boundary parameter in the header, the Connect-REST multipart requests to Box fail since Box treats this as a bad request.
Error Messages
Error Message: Document upload/move failed; Service Name: Create File; Error Code from Service: 500; Error Message from Service: ; Status: Fail: Unexpected HTTP 500 Response code; Status Message: the HTTP response code of 500 indicated a server error. The response data may contain a reason. // The body of the service's response, which is set up for mapping in the Connector rule, was empty for this service call.;
Steps to Reproduce
- Create a Connect-REST Integration in Pega such that it sends a multipart attachment.
- Capture the Connect-REST multipart request generated by Pega using tcpmon.
Root Cause
A defect in Pegasystems’ code or rules.
Resolution
Apply HFix-45282.
Published March 29, 2019 - 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.