【发布时间】:2016-02-13 14:57:00
【问题描述】:
我正在使用 angular2-http(alpha.44) 模块从 REST Api 检索数据。我不知道如何访问响应的标头映射中的信息,我需要一个特定的字段。示例:
var req = new Request({
url: `localhost/api/products`,
method: RequestMethods.Get
});
this.http.request(req).subscribe(
res => {
// Can't access the headers of the response here.... res.headers is empty
},
error => { ... },
_ => {}
);
奇怪的是,如果我在浏览器的开发工具中检查网络流量,就会出现响应头...
【问题讨论】:
标签: angular