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?