在我的angular 2应用程序中,我向服务(HTTPS)发送HTTP POST请求,服务 返回的HTTP响应具有自定义RESPONSE标头“X-COUNT”,但在下面的代码中,console.log不会打印关于自定义标题“X-COUNT”的信息,但它确实会打印有关其他标题的信息 。在Angular 2中读取自定义HTTP响应标头
this._http.post(restUri, postdata, options)
.map(itemsResult =>
{
console.log(JSON.stringify(itemsResult.headers));
return items;
}).catch((err) => {
return Observable.of([]);
});
任何想法,为什么我无法获得自定义标题信息。
帮助链接https://stackoverflow.com/questions/25673089/why-is-access-control-expose-headers-needed – refactor