admin管理员组文章数量:1417550
I'm using Axios to make a secure POST call to an API. This returns an URL within the response headers under 'Location'.
I can see the URL being populated within Chrome's dev tools:
but the response inside JS from Axios (below) doesn't contain this information:
Any advice greatly received!
I'm using Axios to make a secure POST call to an API. This returns an URL within the response headers under 'Location'.
I can see the URL being populated within Chrome's dev tools:
but the response inside JS from Axios (below) doesn't contain this information:
Any advice greatly received!
Share Improve this question edited Jun 20, 2020 at 9:12 CommunityBot 11 silver badge asked Jul 11, 2017 at 14:27 RichRich 1,0512 gold badges18 silver badges43 bronze badges 2- Possible duplicate of Axios get access to response header fields. – Rita Kondratyeva Commented Sep 2, 2017 at 17:31
- Please find another detailed discussion regarding the same here – Apurva jain Commented Oct 2, 2017 at 14:57
1 Answer
Reset to default 2Possibly it occurs because you are doing a cors request that doesn't expose location header by default.
You need to add this Cors Configuration to your server side app.
Access-Control-Expose-Headers: Location
as you can see here: https://developer.mozilla/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers
本文标签: javascriptaccessing response header via AxiosStack Overflow
版权声明:本文标题:javascript - accessing response header via Axios - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745273100a2651016.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论