Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

326
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda