Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3630

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

$
0
0

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:

----------------------------070283320981520286806479Content-Disposition: form-data; name="myInfo"Content-Type: application/json{"firstName": "John","lastName": "Doe","middleInitial": "A"}----------------------------070283320981520286806479Content-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.


Viewing all articles
Browse latest Browse all 3630

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>