美文网首页
如何跨域取到response额外的的headers

如何跨域取到response额外的的headers

作者: 小骆驼与秀秀 | 来源:发表于2021-01-08 23:58 被阅读0次

如何跨域取到 response 额外的的 headers

参考链接

默认,跨域情况下,浏览器的 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