Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

204
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda