Response header not showing

心不动则不痛 提交于 2019-12-01 10:38:14

You must configure the server to which the request is going to so its response has an Access-Control-Expose-Headers header whose value include the name of your custom response header.

Otherwise, if your browser does not see the name of your custom header in that Access-Control-Expose-Headers header, it won’t let you access the value of your custom response header.

In such a case it’s expected that you’d still be able to see the custom header if you look at the response in Postman or even in your browser devtools.

But just because that browser is getting the custom header in the response does not mean the browser will expose it to your client-side JavaScript code.

For cross-origin requests, the browser will only expose that custom response header to your client code if that header name is in the value of the Access-Control-Expose-Headers header.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!