How to See Authorization Header that set by Axios?
See original GitHub issueHi
How can I see what is actually being sent by axios. I set my authorization header but I cannot see what is being sent to the server. I checked FF and Chrome but I see nothing regarding authorization headers.
Is there away I can print it out?
export const axiosInstance = axios.create({
baseURL: getBaseUrl(),
timeout: 5000,
contentType: 'application/json',
Authorization: 'Bearer 14154151'
});
“axios”: “^0.18.0”,
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top Results From Across the Web
How to send authorization header with axios - Stack Overflow
const header = `Authorization: Bearer ${token}`; return axios.get(URLConstants.USER_URL, { headers: { header } });. Gives me this error:
Read more >How to send the authorization header using ... - Flavio Copes
To set headers in an Axios POST request, pass a third object to the axios.post() call. You might already be using the second...
Read more >Using Axios to set request headers - LogRocket Blog
Axios methods such as post() and get() enable us to attach headers to requests by supplying a headers' object as the second parameter...
Read more >Set the Authorization Header with Axios - Mastering JS
Setting request headers with Axios is easy. Here's how you can set the Authorization header, which is typically used to send access tokens ......
Read more >How To Set Request Headers Using Axios? - RapidAPI
Your application may have multiple API requests, and you may want to set request headers for all of them. Instead of adding the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can see the raw headers sent by inspecting the response. Here’s an example using a response interceptor:
However, the problem with your setup is that you’re using
Authorization
as if it were a config option foraxios
, which it is not. It is an HTTP header that you need to set. Same problem withcontentType
. So, you just need to slightly modify your setup like this:See the request config section of the readme for a list of all the options.
Closed due to stale.