When calling my REST Service in Angular, there are no response headers.
Login method in Angular
The headers in an HttpResponse object are lazy-loaded, so headers
will appear to be empty until you force the values to be loaded. Try calling response.headers.keys()
to see all available header names. By the way, this also forces all values to be loaded into the map response.headers.headers
.
Be sure to use headers.get('my-header-name')
if you only need to access one particular header value.