【发布时间】:2018-01-26 03:44:15
【问题描述】:
我正在尝试从发布请求中获取响应标头,但 HttpResponse 对象不包含我在网络中可以看到的相同标头。我究竟做错了什么?我需要访问 Apiproxy-Session-Id 键的值,它不存在于 HttpHeaders 中。
这是我执行 post 请求并记录完整响应的代码,其中 http 是一个 HttpClient 对象。
this.http.post('http://localhost:8081/user/login',
JSON.stringify(requestBody), {observe: 'response'}).subscribe(resp => {
console.log(resp);
});
This is the response I'm logging.
These are the headers I'm seeing in the network.
我是 Angular 的新手,对此感到非常困惑。谢谢你的帮助!
【问题讨论】:
-
您的问题解决了吗?
标签: angular http-headers httpresponse angular-http angular-httpclient