Angular 2:从响应中检索标头

时间:2016-12-22 13:48:40

标签: angular angular2-headers

我使用observable从WS发出请求。 我想获得一些特定的标题,但我无法得到它们。

我找到了这个discussion,并按照他们提出的解决方案,但是,它对我没用。

例如: 进入chrome标签网络,我的标题是:

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=/

执行此操作时,仅返回Cache-ControlContent-Type

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

是否有其他方法可以使用Angular 2检索Set-Cookie标头?

0 个答案:

没有答案