title: How do I specify content-type with a AJAX call for Android browsers?
body: <p>I have an ajax call that goes out to my rails server. Depending on the content type my rails server either responds with HTML or JSON. This works fine on the iPhone browser and on desktop browsers like chrome, etc. However on the Android browser somehow my server is not recognizing the content type. I don't think the overrideMimeType is working! </p>
  
  <p>Anyone know of a workaround? If I can't figure it out I'll just have to create a special URL to handle the JSON requests.</p>
  
  <p>Code looks something like this :</p>
  
  <pre><code>function makeAjaxCall {
      xmlhttp=new XMLHttpRequest();
      targetUrl = window.location.pathname;
      xmlhttp.open('GET',targetUrl,true);     
      xmlhttp.overrideMimeType("application/json");
      xmlhttp.onreadystatechange=function()
      {
  
        if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200)
        {
                // On android browsers only this responds with HTML when it should be JSON
          alert('response:' + xmlhttp.responseText);
          r = eval('(' + xmlhttp.responseText + ')');
                      // Do more stuff
        }
      }
      xmlhttp.send();
  }
  </code></pre>