Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

334
Views
How to dynamically save a binary GET response with Postman?

So, there is a REST API which is used to migrate some data in .zip format. The API answers the GET requests with the byte content of the requested file. I use Postman to perform the requests in order to automate the migration process.

I need to save the byte response without having to click on "send and download" since I need to send multiple requests and dynamically save all the files.

I made several attempts:

  • Save the binary response as-is to a collection variable with pm.collectionVariables.set('file', responseBody) and then POST it to a localserver which reads the data and saves it to a file. This results in an invalid zip file.
  • Convert the binary data to base64 using btoa(), save the encoded string in a collection variable and then POST the base64 encoded string to a (python) localserver and decode it with base64.b64decode(data). Again, after writing the data to a file (in binary format, of course), this results in another invalid zip file.

If I click "save and download" on the postman GUI I can successfully save the zip file which is valid. Hence the API surely answers with a valid binary content.

I know that Postman uses javascript and in my localserver I use python and the mix is sub-optimal, but base64 encoding is universal, right?

Additional info which might be useful: the API answers with Content-Type: "application/octet-stream; charset=UTF-8" and Content-Disposition: attachment; filename="webseal_config.zip"; filename*=UTF-8''webseal_config.zip. I don't really understand the practical consequences of the latter header, maybe the response not only contains the binary content but also the filename and I have to process the data in some way?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!