title: How can I clear HTTP headers for AJAX GET calls?
body: <p>I have developed a solution that relies on an AJAX call to retrieve information and update the client page every 10 seconds. This is working fine, but I am concerned at the scalability of the code, given the number and length of headers being passed from client to server and back again. I have removed a number of redundant headers on the server side, mostly ASP.NET-related, and now I'm attempting to cut down on the headers coming from the client.</p>
  
  <p>The browser used by my company is IE (version 6, to be upgraded to 7 soon). This is an approximation of my current code:</p>
  
  <pre><code>var xmlHTTP = new ActiveXObject('Microsoft.XMLHTTP');
  
  xmlHTTP.onreadystatechange = function() {
      if ((xmlHTTP.readyState == 4) &amp;&amp; (xmlHTTP.status == 200)) {
          myCallbackFunction(xmlHTTP);
      }
  };
  
  xmlHTTP.open('GET', 'myUrl.aspx');
  
  try {
      xmlHTTP.setRequestHeader("User-Agent", ".");
      xmlHTTP.setRequestHeader("Accept", ".");
      xmlHTTP.setRequestHeader("Accept-Language", ".");
      xmlHTTP.setRequestHeader("Content-Type", ".");
  } catch(e) {}
  
  xmlHTTP.send();
  </code></pre>
  
  <p>Although <a href="http://blog.mibbit.com/?p=143" rel="nofollow noreferrer">I've read</a> that it's possible to clear some of these headers, I haven't found a way of doing it that works in IE6. Setting them to null results in a Type Mismatch exception, so I've ended up just replacing them with '.' for the time being. Is there another way of clearing them or an alternative method of reducing the submitted HTTP headers?</p>
  
  <p>Also, there seems to be no way of replacing or shortening the 'Referrer' header at all.</p>