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)

@MaxonL16591286

f.y.i, the verified correct input in Postman is as below sample

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.

@ArulDevan

thanks.

However I found a link in the article is not available any more

https://customer-coml-dev731.cmp.dev.cba/prhelp/procomhelpmain.htm#rule-/rule-connect-/AttachmentsSOAPdotNetHttp.htm?Highlight=pyRequestAttachmentPage

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.

@ArulDevan

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.

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.

@ArulDevan

many thanks.

yes, the last share links (to office documents) is most important to me who is new to this problem at all.