Forum Discussion

rluedders's avatar
Frequent Visitor
8 years ago

In a REST request , how can I submit a Content-Type for each part in multipart request

I'm trying to use SoapUI to test a REST service that accepts a multipart POST. The first part being JSON, the second being a file.


I've been able to tell SoapUI to submit the request as multipart and build the parts from the QUERY parameters.


The problem: I can't find a way to tell SoapUI to use a Content-Type: application/json header for the first part in the multipart request - Is this a feature that is supported by SoapUI (or could be added?)



Here is as far as I've gotten:


POST http://localhost:8080/rest/path/hello.txt HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: multipart/form-data; boundary="----=_Part_33_1474532169.1469024696152"
MIME-Version: 1.0
Content-Length: 29328
Host: localhost:8080
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: form-data; name="indexfields"

{ "firstname" : "hello", "lastname" : "world" }
Content-Type: application/pdf
Content-Transfer-Encoding: binary
Content-Disposition: form-data; name="file"; filename="example-file.pdf"




No RepliesBe the first to reply