wymsee / cordova-HTTP

Cordova / Phonegap plugin for communicating with HTTP servers. Allows for SSL pinning!
MIT License
372 stars 301 forks source link

Remove header #74

Closed enricodeleo closed 8 years ago

enricodeleo commented 8 years ago

Hi! As far as I can see there is a (very handy) method that adds default headers on all subsequent requests, but there is not a method to remove an header. Am I wrong? Any idea on how to do it?

I tested passing the null for example to useBasicAuth but it seems that once set the header persist untile the app is killed..

allie-wake-up commented 8 years ago

There is currently not a way to do this. With the latest version the setHeader code is now just in javascript so it would be very easy to add a delete method. Another workaround is using the new getBasicAuthHeader call and instead passing your headers in with every request.

enricodeleo commented 8 years ago

@TheKiteEatingTree thank you for the hint. I was using a fork of the repo (since I needed to add a dynamic base url in angularjs and some little customizations) and I missed the new version with js headers (neat!). It is indeed easy to manage headers now. Thank for the hints!