title: Http-Method changes from POST to OPTIONS when changing Content-Type
body: <p>I am using closure library to do a simple POST. I think XhrIo should work because from my machine when I use any other rest client ,like Firefox browser app RESTClient or Chrome's Simple Rest Client , I can make POST request to the server and content type is application/json.</p>
  
  <p>But from my application I am unable to make a post.
  I am using the following code</p>
  
  <pre><code>xhr = new goog.net.XhrIo;
  xhr.send('http://myhost:8181/customer/add','POST', goog.json.serialize(data));
  </code></pre>
  
  <p>If I leave the headers default, I get this </p>
  
  <blockquote>
  <pre><code>Encoding: UTF-8
  Http-Method: POST
  Content-Type: application/x-www-form-urlencoded;charset=UTF-8
  </code></pre>
  </blockquote>
  
  <p>If I try to change the header by passing <code>{'content-type':'application/json'}</code> as 4th parameter, header changes to </p>
  
  <blockquote>
    <p>Http-Method: OPTIONS<br>
     Content-Type:</p>
  </blockquote>
  
  <p>Shouldn't I be able to change headers appropriately with Closure library just as RESTClient does with XMLHttpRequest using JQuery ?</p>
  
  <p>How else can the header be altered to make it appear like this </p>
  
  <blockquote>
  <pre><code>Encoding: UTF-8
  Http-Method: POST
  Content-Type: application/json;charset=UTF-8
  </code></pre>
  </blockquote>
  
  <p>Appreciate any help
  Eddie</p>