title: javascript does not send post request correctly
body: <p>Well I am trying to post some data to a certain site in order to g, but javascript does not seem to like me that much :(.
  To perform the request I do:</p>
  
  <pre><code>  var xmlhttp;
      if (window.XMLHttpRequest)
      xmlhttp=new XMLHttpRequest();
      else
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      xmlhttp.open("POST","http://(removed)/forums/en/shoutbox_comet.php",true);
      xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=utf-8");
      xmlhttp.setRequestHeader("X-Request","JSON");
      xmlhttp.setRequestHeader("Cookie",document.cookie); 
      xmlhttp.onreadystatechange=function(){
      if (xmlhttp.readyState==4)
      alert(xmlhttp.responseText);
      }
      var channels = ['english_486', 'english_0', 'english_459','english_293','english_1310','english_292','english_459','english_293','english_970'];
      var channel = channels[Math.floor(Math.random() * channels.length)];
      var data = "channel="+channel+"&amp;action=publish&amp;type=message&amp;data=HelloWorld";
      xmlhttp.send(data);
  </code></pre>
  
  <p>which sends this:</p>
  
  <pre><code>OPTIONS http://(removed)/forums/en/shoutbox_comet.php HTTP/1.1
  Host: (removed)
  User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0
  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  Accept-Language: en-US,en;q=0.5
  Accept-Encoding: gzip, deflate
  Origin: http://(removed)
  Access-Control-Request-Method: POST
  Access-Control-Request-Headers: x-request
  Connection: keep-alive
  Pragma: no-cache
  Cache-Control: no-cache
  </code></pre>
  
  <p>how can I fix this?
  I want it to send:</p>
  
  <pre><code>POST http://(removed)/forums/en/shoutbox_comet.php HTTP/1.1
  Host: (removed)
  User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0
  Accept: application/json
  Accept-Language: en-US,en;q=0.5
  Accept-Encoding: gzip, deflate
  X-Requested-With: XMLHttpRequest
  X-Request: JSON
  Content-Type: application/x-www-form-urlencoded; charset=utf-8
  Referer: http://(removed)/forums/en/shoutbox_comet_standalone.php?f=293&amp;style=popout
  Content-Length: 55
  Cookie: (removed)
  Connection: keep-alive
  Pragma: no-cache
  Cache-Control: no-cache
  
  channel=english_293&amp;action=publish&amp;type=message&amp;data=HelloWorld
  </code></pre>