question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Don't send default header

See original GitHub issue

If a header has been set as a default, there does not appear to be any way to skip it on an individual request. Setting null or undefined doesn’t do anything.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:56
  • Comments:71 (5 by maintainers)

github_iconTop GitHub Comments

128reactions
aaronatmycujoocommented, Sep 28, 2017
transformRequest: [(data, headers) => {
    delete headers.common.Authorization
    return data
}]

works for me

64reactions
axelgenuscommented, Feb 21, 2017

I had the same problem but solved with

delete axios.defaults.headers.common["Authorization"]; // or which ever header you have to remove

Read more comments on GitHub >

github_iconTop Results From Across the Web

Axios - Remove headers Authorization in 1 call only
You can change the default headers to an empty string, ... A simple solution is to remove all common header from a new...
Read more >
HTTP Requestor Default Header - how to not pass ...
In the HTTP requestor Connector, i want to send a Default Header to the target . I am able to accomplish it to...
Read more >
Config Defaults | Axios Docs
Config Defaults. You can specify config defaults that will be applied to every request. ... axios.defaults.headers.common['Authorization'] = AUTH_TOKEN; ...
Read more >
Fetch API
These options govern how fetch sets the HTTP Referer header. ... "same-origin" – the default, don't send for cross-origin requests, ...
Read more >
Using Axios to set request headers
We can address this by specifying configuration defaults. This code sets authorization headers for all requests: axios.defaults.headers.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found