I'm sending a request to a node
server; the server responds with headers and a blank body. I can see the headers in the network activity panel in dev-tools but was unable to read them. This is my code:
let uploaded = await fetch(presignedUrl, {
method: 'PUT',
body: blob
}).then(response => {
console.log('test 1 -', response.headers);
response.headers.forEach(item => {
console.log('test 2 -', item);
});
for (var pair of response.headers.entries()) {
console.log('test 3 -', pair[0] + ': ' + pair[1]);
}
console.log('test 4 -', response.headers.get('ETag'));
});
This is what it returns: https://i.stack.imgur.com/TF1Lq.png
i have tried foreach and entries , get functions of herder class too. the issue might be that i'm making a aws s3 put reuest (CORS) the upload was success full their were no error of any kind with request, it just i'm unable to read response ETag headers.