Skip to content Skip to sidebar Skip to footer

Accessing Response Header Via Axios

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:

Solution 1:

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

Post a Comment for "Accessing Response Header Via Axios"