swangkkb / rest-assured

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

How to set additional headers and content type to multiPart section just like org.apache.wink.common.model.multipart.OutPart provides. #245

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm looking for a way to add additional headers and content-type to multipart 
section, for example I would like to be able to add 

Content-Disposition: form-data; name="uploadedfile"; filename="test.xls"
Content-Transfer-Encoding: binary
Content-Type: application/vnd.ms-excel

What is the expected output? What do you see instead?
Without providing headers/content-type to the multipart, the Rest API i am 
trying to invoke does not work. It does not upload the excel file to the server 
if multipart headers/content-type are not provided.

What version of the product are you using? On what operating system?
    I am using latest version of Rest Assured library (rest-assured-1.8.1.jar) on Windows 7 OS.

Please provide any additional information below.
    If normally i set the header/content-type to the request then it will just be added to the request and not to a particular multi-part section.
Please look closely into the issue as it is a basic requirement.

Original issue reported on code.google.com by tushar.t...@gmail.com on 14 Jun 2013 at 7:43

GoogleCodeExporter commented 9 years ago
You can try using the com.jayway.restassured.builder.MultiPartSpecBuilder, if 
this doesn't work please re-open the issue.

Original comment by johan.ha...@gmail.com on 14 Nov 2013 at 8:58