Forum Discussion

anita's avatar
anita
New Contributor
5 years ago

multipart/form-data post request is not working on SoapUI but works fine in Postman

I'm testing a multipart/forma-data request to upload a file(image-jpg, doc, etc) in SOAP UI. It gives 200 success message but does not uploads the file. The same request is working fine through the Postman tool.

I followed the same steps which are mentioned at most of the forum's to resolve such issues with the attachments in SOAP UI. I am adding one of the link below which I referred while configuring this on SOAP UI.

https://stackoverflow.com/questions/12467901/soapui-multipart-form-data-rest-request-with-file-attachments

I attached my configuration in SOAP UI .

 

The only difference I can see with respect to Postman is that the SOAP UI generates the boundaries for multipart-form-data differently. It does not add boundary end tag after the contents. I am not sure if that is an issue here.

2 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3

    Please compare the headers in both the tools. May be some tool is easier than others but should work in SoapUi as well and this is very common use case.

    What version of the tool, OS details?

  • anita's avatar
    anita
    New Contributor

    I am using Windows 10 with SoapUI 5.5.0 version. I compared the request header in both the tools. The only difference is that in SoapUI there is no boundary end tag and there is binary encoding specified on the form part.

     

    SOAP UI request header - 

    Accept-Encoding: gzip,deflate
    Content-Type: multipart/form-data; boundary="----=_Part_2_1383021.1587674256869"
    MIME-Version: 1.0
    Content-Length: 695092
    Host:XXXXXXXXXXX
    Connection: Keep-Alive
    User-Agent: Apache-HttpClient/4.1.1 (java 1.5)


    ------=_Part_2_1383021.1587674256869
    Content-Type: image/jpeg
    Content-Transfer-Encoding: binary
    Content-Disposition: form-data; name="Component_Content"; filename="flower.jpeg"

     

    Postman request header -
    Cache-Control: no-cache
    Postman-Token: XXXXX
    Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

    ------WebKitFormBoundary7MA4YWxkTrZu0gW
    Content-Disposition: form-data; name="Component_Content"; filename="flower.jpg"
    Content-Type: image/jpeg


    ------WebKitFormBoundary7MA4YWxkTrZu0gW--