Question

2
Replies
1726
Views
bhatg Member since 2016 1 post
PEGA
Posted: 1 year ago
Last activity: 1 year 11 months ago
Closed

Multipart Connect-Rest post request

Hi,

For one of our requirement, we need to send zip files to client along with json data in Connect-Rest post request. Below is the request format we need to send

metadata:
body:
{
"personId":"personId",
"documentType":"DISPUTES",
"documentTitle":"response",
"description":"blah blah",
"caseId":"pega",
"agentUserId":"name of the agent that uploads the document",
"inboundChannel":"NETWORK"
}
file:

For json data, I have created the data transform and mapping the request and for file data I am setting properties ".pyAttachNames to file, .pyAttachTypes to zip, .pyAttachValues to attach stream and .pyAttachFileNames to actual filename with extension" in pyRequestAttachmentPage.

In Connect-Rest rule post method, I am mapping request from clipboard property .request.body_POST, however i am getting 400 bad request error when the rest rule is invoked. When i checked log after setting loggers i can see below messages

Adding outbound message data to the POST request

Request attachment page detected. Attemtping to construct multipart message.

Multipart request message has been constructed.

Request message size is 24850 bytes.

HTTP Status code: 400 Bad Request

It would be helpful if anyone knows how to debug and correct the issue.

Data Integration
Moderation Team has archived post
Share this page LinkedIn