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

203
Vistas
Response.header in console shows blank, but in the network tab there are headers

I am trying to programmatically access the headers of a response.

PS: Using Chrome. If I add a breakpoint and inspect the response object, it looks like it has no headers.

If I try print of the headers, both of these log statements show {}:

    const response = await fetch(request);
    console.log('headers stringify:', response.headers);
    console.log('headers:', JSON.stringify(response.headers));

However in the Chrome dev tools Network tab it shows the response had headers. How does one access the headers of a response object?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Thanks to @alittleSalty for the link which explains the headers are an iterable, and can be seen with:

response.headers.forEach((value, key) => console.log("header:", key, 'value:', value));
about 4 years ago · Juan Pablo Isaza Denunciar
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