Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular8 get full of HttpClient response headers

I'm using HttpClient to request a json file. I want the file can be cached with ETag. But it not works. I think that The If-None-Match not send to the server is the reason. So I want to get The 'ETag' from response headers. But the response header not has the item in Angular, But It's truly in the HTTP response in chrome network tool. All of showing in follow images.

The HttpClient response headers

The Http response headers

How can I get the ETag from response Header

like image 652
xsong Avatar asked Dec 07 '25 12:12

xsong


1 Answers

I think it's similar to this : HttpClient dont return all headers.

You need to setup your backend to return Access-Control-Expose-Headers:ETag.

like image 115
Kaybab Avatar answered Dec 09 '25 02:12

Kaybab



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!