Forum Discussion

kanemeyer's avatar
kanemeyer
Occasional Contributor
9 years ago
Solved

Content-Disposition Name

I was wondering if there was any way to remove the quoatation from name of the content-disposition when doing a multipart file upload. the api i am connecting to only accesss the name without quotations. 

 

Expeted:

--e1fbdde9-d4d1-4038-b7a6-47c535b390fd

Content-Type: text/plain; charset=utf-8

Content-Disposition: form-data; name=fileType

 

SoapUI:

------=_Part_0_41673494.1447705176576
Content-Type: text/plain; charset=UTF-8
Content-Disposition: form-data; name="fileType"

  • So, you need to remove the double quotes covering the name attribute. There are several ways to do this,

    1) If you are Pro (Ready! API) users, you can capture the formatted request through SoapUI's event listeners and edit the request through Groovy Script. Don't worry if you are an open source users! There is a workaround to do the same using the method mentioned by nmrao in the thread - http://community.smartbear.com/t5/SoapUI-Open-Source/How-to-add-addtional-HTTP-header-to-all-the-Rest-Requests/m-p/108768#U108768

    2) [EASY WAY] Track the request sent by SoapUI using any of the HTTP debugger tools like Fiddler, Burp Suite, HTTP Watch etc and recompose the request by removing the quotes covering name attribute.

     

    Hope this helps!

     

    Thanks,

    Samy

     

    Did my reply answer your question? Give Kudos or Accept it as a Solution to help others, Thanks. ↓↓↓

4 Replies

  • kondasamy's avatar
    kondasamy
    Regular Contributor

    So, you need to remove the double quotes covering the name attribute. There are several ways to do this,

    1) If you are Pro (Ready! API) users, you can capture the formatted request through SoapUI's event listeners and edit the request through Groovy Script. Don't worry if you are an open source users! There is a workaround to do the same using the method mentioned by nmrao in the thread - http://community.smartbear.com/t5/SoapUI-Open-Source/How-to-add-addtional-HTTP-header-to-all-the-Rest-Requests/m-p/108768#U108768

    2) [EASY WAY] Track the request sent by SoapUI using any of the HTTP debugger tools like Fiddler, Burp Suite, HTTP Watch etc and recompose the request by removing the quotes covering name attribute.

     

    Hope this helps!

     

    Thanks,

    Samy

     

    Did my reply answer your question? Give Kudos or Accept it as a Solution to help others, Thanks. ↓↓↓

    • nmrao's avatar
      nmrao
      Champion Level 3
      Just a comment regarding #2. That works only for manually testing using soapUI. Does not be of help for automated testing.
      • kondasamy's avatar
        kondasamy
        Regular Contributor

        nmrao: The name header would be an auto generated in SoapUI when we pass corresponding value in any multipart attachments. Yes! I agree the method #2 would not give helping hand while automation, but if the user prefers Fiddler, there is a light of possibility through their scripting method to to do a partial automation.

         

        Thanks,

        Samy

  • nmrao's avatar
    nmrao
    Champion Level 3
    Just curious if the header is being added automatically or do you add it to the request? You may also try adding manually with desired value for the header.