如何跨域取到 response 额外的的 headers
默认,跨域情况下,浏览器的 response 的 headers 只返回:
Cache-Control
Content-Language
Content-Type
Expires
Last-Modified
Pragma
如果要读取其他属性,需要在发送的请求头增加以下代码:
'Access-Control-Expose-Headers': ['Content-Disposition']
即可解决
默认,跨域情况下,浏览器的 response 的 headers 只返回:
Cache-Control
Content-Language
Content-Type
Expires
Last-Modified
Pragma
如果要读取其他属性,需要在发送的请求头增加以下代码:
'Access-Control-Expose-Headers': ['Content-Disposition']
即可解决
本文标题:如何跨域取到response额外的的headers
本文链接:https://www.haomeiwen.com/subject/hzvqaktx.html
网友评论