14 years ago
How to send multipart/mixed rest request to upload files
Hi:
I need to send a rest request with media type as multipart/mixed.
When I add the attachments with media type set to multipart/mixed, SOAPUI doesn't send the attachments to the server.
When I set the Media Type as multipart/form data, it inserts the attachments in the request. But my server expects multipart/mixed request.
I need the request to look something like this.
POST /a/test.xml HTTP/1.1
Accept: */*
Content-Length: 410236
Content-Type: multipart/mixed; boundary=###-------Thu Jan 06 11:53:12 -0800 2011-----####
Host: localhost:8080
--###-------Thu Jan 06 11:53:12 -0800 2011-----####
Content-Disposition: name="main";"
Content-ID: main
Content-Type: application/xml
<some xml here>
--###-------Thu Jan 06 11:53:12 -0800 2011-----####
Content-Disposition: name="file"; filename="winter.jpg"
Content-Type: image/jpeg
<binary form of the image file>
--###-------Thu Jan 06 11:53:12 -0800 2011-----####
Thanks for your help!
Vidya
I need to send a rest request with media type as multipart/mixed.
When I add the attachments with media type set to multipart/mixed, SOAPUI doesn't send the attachments to the server.
When I set the Media Type as multipart/form data, it inserts the attachments in the request. But my server expects multipart/mixed request.
I need the request to look something like this.
POST /a/test.xml HTTP/1.1
Accept: */*
Content-Length: 410236
Content-Type: multipart/mixed; boundary=###-------Thu Jan 06 11:53:12 -0800 2011-----####
Host: localhost:8080
--###-------Thu Jan 06 11:53:12 -0800 2011-----####
Content-Disposition: name="main";"
Content-ID: main
Content-Type: application/xml
<some xml here>
--###-------Thu Jan 06 11:53:12 -0800 2011-----####
Content-Disposition: name="file"; filename="winter.jpg"
Content-Type: image/jpeg
<binary form of the image file>
--###-------Thu Jan 06 11:53:12 -0800 2011-----####
Thanks for your help!
Vidya