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.

How I can get default headers?

See original GitHub issue

I can set headers like this:

Restangular.setDefaultHeaders({Authorization:'something'});

but later I would like somehow get or delete some headers how can I do this?

as an example I would like to delete authorization header after logout, but I don’t know maybe some other modules added other headers too so I just want to delete only authorization header.

UPDATE:

I could go with:

$httpProvider.defaults.headers.common

But what if I have two or more rest api’s and each one has its own requirements?

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
mgontocommented, Aug 14, 2013

The getter is defaultHeaders. Let me know if this works for you!

0reactions
mgontocommented, Aug 16, 2013

Sorry for the problems. Try it out now! in 1.1.3

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTP headers - MDN Web Docs - Mozilla
These headers must be transmitted to the final recipient of the message: the server for a request, or the client for a response....
Read more >
Default headers - Ktor
The DefaultHeaders plugin adds the standard Server and Date headers into each response. Moreover, you can provide additional default headers ...
Read more >
Default HTTP headers - TestMace
You can define your default headers in the Folder node. To do this, click on the Headers button on the Folder node toolbar....
Read more >
What is the request header by default in python requests
I can get response header by r.headers , but I need request header and I don't know how I should get it. can...
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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