我试图从post请求中获取响应头,但HttpResponse对象不包含我在网络中可以看到的相同头。我究竟做错了什么?我需要访问Apiproxy-Session-Id密钥的值,并且它不在HttpHeaders中。在Angular中从HttpClient 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.
我新的角度和这个非常难住了。谢谢你的帮助!
您的问题解决了吗? – theLearner