Question
IBM
CN
Last activity: 22 Oct 2024 2:22 EDT
how to create a REST API with Content-Type=multipart/form-data
how to create a REST API that require Content-Type=multipart/form-data?
I tried to use wizard, when I went to below step to input a sample request and get a sample response,
even I specify Content-Type=multipart/form-data, the data format allowed for input in request is still Json or XML
I am unable to input form fields data, then when I run this request, I got below error, because the file part is also a form data (type file)
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 21 Oct 2024 23:44 EDT
NCS Pte. Ltd
SG
Hi @MaxonL16591286: You may refer this and this for info in documentation page. In my view, documentation may not be able to cover all the scenarios but there are info on the use case. Support community is the place where we share the knowledge.
Thanks.
IBM
CN
f.y.i, the verified correct input in Postman is as below sample
NCS Pte. Ltd
SG
Hi @MaxonL16591286: I'm not sure if the wizard helps you to simulate the model for multipart/formdata. But when preparing the request while designing, you can create a page (pyRequestAttachmentPage) as mentioned in this article to send the data multipart/formdata.
Thanks.
IBM
CN
thanks.
However I found a link in the article is not available any more
NCS Pte. Ltd
SG
Hi @MaxonL16591286: You may ignore the link in the main question. Its a help link referred from the environment used by the Question Author.
Please refer to the links given in the comment by Moderator team. The idea is to use pyRequestAttachmentPage page to use Content-type multipart/form-data.
Thanks.
IBM
CN
Does Moderator team refer to below member "Marije Schillern", right?
Also, for such a commonly used function, suggest to consolidate to an official Pega document instead of study it from several articles scattered in Pega support websites.
Accepted Solution
Updated: 21 Oct 2024 23:44 EDT
NCS Pte. Ltd
SG
Hi @MaxonL16591286: You may refer this and this for info in documentation page. In my view, documentation may not be able to cover all the scenarios but there are info on the use case. Support community is the place where we share the knowledge.
Thanks.
IBM
CN
many thanks.
yes, the last share links (to office documents) is most important to me who is new to this problem at all.