Radonirina Maminiaina
Radonirina Maminiaina

Reputation: 7004

Angular 2: retrieve headers from response

I'm using observable to make request from a WS. I want to get some specific headers, but I can't get them.

I found this discussion and followed the solution they proposed but, it doesn't work for me.

For example: Into chrome tab network, my headers are:

Access-Control-Allow-Headers:origin, content-type, accept, x-wsse, set-cookie
Access-Control-Expose-Headers: set-cookie
Cache-Control:no-cache
// ...
Content-Type:application/json
Set-Cookie: SESSIONID=9o0cu34k0t4av9mn1apu8xoa55; expires=Thu, 22-Dec-2016 14:42:57 GMT; Max-Age=3600; path=/

Only the Cache-Control and Content-Type are returned when I do this:

this._http.post(CONFIG.getProtocole.protocole() + url, paramsRequest).map(
   (res) => {
       console.log(res.headers);
   }
);

Is there another way to retrieve Set-Cookie header with Angular 2?

Upvotes: 1

Views: 193

Answers (0)

Related Questions