Question

3
Replies
497
Views
RevanthV2727 Member since 2018 3 posts
Coforge DPA
Posted: 11 months ago
Last activity: 7 months ago

Send key-value pair requests to a service as multipart/form-data using connect-rest

I am trying to pass key-value pairs in the format of multipart/form-data as request to a service using connect-rest in post method as body,

So I have referred to few PDN articles on about how to pass request using connect-rest, Most scenarios were a file or string can be passed as multipart/form-data by setting the values in pyRequestAttachment page belonging to Data-ServiceMessage class and leaving the message body blank in post method of the connect-rest.

I tried to implement the same but unsure how to set key-value pairs in pyRequestAttachmentPage using a DataTranform or activity and I am unaware how the values are sent via connect-rest since i am not able to see the request in the connect-rest page in tracer.

Request to be sent: sample data = {"Username":"123456", "UserID":"testuser"}

I am setting in the below following format as of now in request Datatransform, also tried many combinations,

.pyAttachNames(1) = "Sample"

.pyAttachValues(1)="{\"Username\":\"123456\", \"UserID\":\"testuser\"}"

.pyAttachTypes(1)=application/json

So far i am not able to hit the service.

Please help me in setting correct format of request for key-value pairs and it should be in multipart/form-data.

Also, please provide any examples or samples if present.

***Edited by Moderator Marissa to update platform capability tags****

Data Integration
Share this page LinkedIn