Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to delete headers #94

Closed
jkeam opened this issue Apr 19, 2017 · 5 comments
Closed

Add a way to delete headers #94

jkeam opened this issue Apr 19, 2017 · 5 comments

Comments

@jkeam
Copy link
Contributor

jkeam commented Apr 19, 2017

Sometimes you set a header but later want to remove it. For example, an Authentication header or something. Would be nice to have a way to do this.

@joaofranca
Copy link

I've been doing it like this. Doesn't this work?

const api = apisauce.create({
    ...
});

...

delete api.headers['Authorization']

@jjercx
Copy link

jjercx commented Nov 15, 2019

yeah, that works 👆🏽

@blaues0cke
Copy link

FYI: This works but triggers no-param-reassign from eslint. Would be nice to be also able to do this using a method.

@jkeam
Copy link
Contributor Author

jkeam commented Nov 28, 2021

Does this method work for you?

11235d2

@Nayan-nandakumar
Copy link

Nayan-nandakumar commented Nov 24, 2024

apiClient.deleteHeader('Authorization'); this will work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants