How to remove HTTP specific headers in Javascript
ajax, http-headers, javascript, xmlhttprequest
Solution
You could use the setRequestHeader method of the XmlHttpRequest object assuming your browser supports it, It is part of the W3C spec. It is also implemented by IE.
var req = new XMLHttpRequest();
req.setRequestHeader("Authorization", "");
Problem
Is it possible to, before sending a http message, remove some specific http headers using javascript / XmlHttpRequest ? I'm using a proprietary browser, so there's no way to do it using browser specific solution. For example, I want to remove the header 'Authorization' before send the message ``` POST /social/rpc?oauth_version=1.0& ... HTTP/1.1 Accept: text/html, image/png, image/*, */* Accept-Language: ko Authorization: Basic Og== Host: test.myhost.com ``` Regards