GET response with application/zip as content-type creation

Hi all,

Basically, I’m trying to mock a behaviour where client downloads a simple zip file from a server.

So I’m trying to create a mock server with an example response to a GET HTTP request. The response is an application/zip content type. I am not sure if the response body is correctly input or what is expected to be.

The url + endpoint set was “{{url}}/things/?id=123”

I was able to run the request in a web browser and saw the zip file gets downloaded with “download.zip”. Once I opened the download.zip, it says “The archive is either in unknown format or damaged”.

I would like to know what am I missing to make this mock server response example to work.

Thanks and regards,
Firdaus.

Hi @mohdfirdaus.hirmanri,

Can you compare the content-length of when you are able to correctly download the zip file with the response you get from mock?

1 Like

Hello Pratik,

If I download the same file from google drive, the content infos are as follows:
content-disposition: attachment;filename=“ExampleZip.zip”;filename*=UTF-8’'ExampleZip.zip
content-length: 149
content-type: application/x-zip-compressed

From mock server, i got as follows:
Content-Length:174
Content-Type: application/zip; charset=utf-8

How do we normally add a zip file into our postman response example? I believe my body content is wrong.

@mohdfirdaus.hirmanri I have the exact issue. Did you manage to solve it?

I’m having the same problem, trying to use the Postman mock-server to return a Zip file. Any progress with this?

Same problem here, any tips?