Forum Discussion

vvenkata's avatar
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
  • ViktorHaag's avatar
    ViktorHaag
    New Contributor
    I also am attempting something very similar to this. I need to send a multipart/mixed POST with two parts: binary object meta-data, content-type application/json, followed by the binary object data itself (content-type dependent upon the file: image, document, whatever).

    There seems another similar post on this topic, with no response. Does this mean that SoapUI can't do this?

    Thanks.