Reputation: 1051
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!
Upvotes: 5
Views: 9141
Reputation: 123
Possibly 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.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers
Upvotes: 2