Ask a Question

UPLOAD A ZIP FILE USING SOAPUI

anthos
Occasional Contributor

UPLOAD A ZIP FILE USING SOAPUI

Could I receive an example of a correct request header to upload a ZIP file using a POST?

Many many thanks

antonio

3 REPLIES 3
richie
Community Hero

Hey @anthos

 

 

the http headers associated with a particular request are specific to that request, so it;s not like people can just tell you what headers you need.   HOWEVER - for certain scenarios there are 'rules' to follow.  (attachments or multi part or form data, or % encoded payloads require certain Content-Type headers).

 

It appears you want to attach a .zip file to a REST request.  Looking at the attachment you included, it appears that you've proxied some requests via fiddler - one of the requests (48_request) was via Postman (due to the inclusion of the auto generated Postman-Token header) and the other (529_request) appears to be the same request, but NOT via Postman - so I'm guessing 529_request was via SoapUI...??

 

If you notice in your Postman request you have a Content-Type header with value 'multipart/form-data;'  - I would suggest you need to set the equivalent in your SoapUI request.

 

I'm guessing about the detail based on your brief description and no info on the fiddler attachment.

 

The more info you provide, the more likely forum members will be able to assist,

 

Cheers,

 

Rich

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
anthos
Occasional Contributor

hi dear

the first attached request header works well (POSTMAN)

POST https://www.sinfi.it/sinfi-validator1/rest/upload?iPlanetDirectoryPro=AQIC5wM2LY4SfcyoFeCBJX5PAhXGBQ... HTTP/1.1
X-OpenAM-Username: DMNRFI20T01H501M
X-OpenAM-Password: SQ6f5&$M
User-Agent: Apache-HttpClient/4.5.5 (Java/12.0.1)
Accept: */*
Postman-Token: b0c09aab-db10-45bf-9306-9b5da5c6a97c
Host: www.sinfi.it
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Type: multipart/form-data; boundary=--------------------------610712940258152505076183
Cookie: amlbcookie=07; SERVERID=2
Content-Length: 31455983

----------------------------610712940258152505076183
Content-Disposition: form-data; name="loadType"

STRICT
----------------------------610712940258152505076183
Content-Disposition: form-data; name="file-value"; filename="TEST_INFR_RT.zip"
Content-Type: application/zip

 

==============================================================

this following request sended via SOAPUI doesn't work.

POST https://www.sinfi.it/sinfi-validator1/rest/upload?iPlanetDirectoryPro=AQIC5wM2LY4SfcyPgdttoQh3vhKa9s... HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: multipart/form-data; boundary="----=_Part_3_237119384.1635864631157"
MIME-Version: 1.0
X-OpenAM-Username: DMNRFI20T01H501M
X-OpenAM-Password: SQ6f5&$M
Content-Length: 15728004
Host: www.sinfi.it
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.5 (Java/12.0.1)


------=_Part_3_237119384.1635864631157
Content-Type: application/zip; name=TEST_INFR_RT.zip
Content-Transfer-Encoding: binary
Content-Disposition: form-data; name="TEST_INFR_RT.zip"; filename="TEST_INFR_RT.zip"

 

 

I don't know how to set SOAPUI parameters to obtain identical Header Request.

Thanks a lot if you can help me 😐

 

KarelHusa
Super Contributor

Hi @anthos ,

what kind of response do you get?

If you:

  • make an HTTP POST request,
  • select multipart/mixed media type and
  • add the zip file as an attachment

SoapUI will then handle all neccessary HTTP headers, unless you have some specific needs.

 

The response message might be a clue what is missing. When comparing your requests it seems that the session identification might be missing:

Cookie: amlbcookie=07; SERVERID=2

 

In such case you can add the HTTP headers (Add a custom HTTP header, just beside the Attachments tab).

 

Best regards,

Karel

 

Karel@apimate.eu
https://apimate.eu
cancel
Showing results for 
Search instead for 
Did you mean: