sahaya / rest-assured

Automatically exported from code.google.com/p/rest-assured
0 stars 0 forks source link

support for multipart/mixed #220

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Setting the content type to multi-part/mixed and inserting multiParts() fails 
to output the body of the request. See forum 
https://groups.google.com/forum/#!topic/rest-assured/nzgFK8bKwqk

Summary:

expect().statusCode(200).given().contentType("multipart/mixed").multiPart("metad
ata", "file", mapper.writeValueAsBytes(doc2), 
"application/json").multiPart("filedata", "HelloWorld.txt", bis2, 
"text/plain").when().put("/documentstore-service/IHE:919191/sections/testSection
1");

doc2 is an object that can be JSON serialised and bis2 is an inputstream with a 
small amount of text available to the reader.

If I leave the contentType() out then it PUTs the whole body of the request 
with a type of multipart/form-data but when I put the content type in it looses 
the body of the request.

Original issue reported on code.google.com by bwalli...@gmail.com on 4 Mar 2013 at 12:25

GoogleCodeExporter commented 9 years ago
Perhaps you could try using the 
com.jayway.restassured.builder.MultiPartSpecBuilder and see if that works

Original comment by johan.ha...@gmail.com on 19 Nov 2013 at 6:47

GoogleCodeExporter commented 9 years ago
Closing because of no response from the issuer

Original comment by johan.ha...@gmail.com on 4 Jun 2014 at 1:38