SoapUI/ReadyAPI - multi-part/form-data REST request. How to set content-type of non-file part?

39 Views Asked by At

In a multi-part request, a non-file part can have one of many content-types (text/plain, application/json and application/xml probably being the most used). In SoapUI or ReadyAPI, I cannot figure out how to get the content-type set for my non-file part. In my example, I'd like to have it set to "application/json".

Here's the UI set up: enter image description here

Here's the raw view:

enter image description here

My goal is to have a payload that looks like this:

----------------------------070283320981520286806479
Content-Disposition: form-data; name="myInfo"
Content-Type: application/json

{
"firstName": "John",
"lastName": "Doe",
"middleInitial": "A"
}

----------------------------070283320981520286806479
Content-Disposition: form-data; name="pdfFile"; filename="a.pdf"
Content-Type: application/octet-stream

[file content redacted for brevity]
----------------------------070283320981520286806479--

I've looked at soapUI: multipart/form-data REST request with file attachments for help with multi-part REST attachments for multi-part requests and that was very helpful. Now I'm stuck on setting the content-type for the non-file part.

I'm not seeing the answer in SoapUI or ReadyAPI's documentation either.

0

There are 0 best solutions below