title: XMLHTTPRequest is not working with IIS integrated Mode
body: <p>While running the code under classic mode works fine.....but it fails when runnnig under integrated mode.</p>
  
  <p>Here is the code: -</p>
  
  <pre><code>function callAjax(method, request, callback) {
      http = newHTTP();
      http.open('POST', url, true);
      setupHeaders(http, method);
      http.onreadystatechange = function () { http_onreadystatechange(http, callback); }
      http.send(JSON.stringify(request));
      return request.id; 
      }
  
  
  function newHTTP() {
  if (typeof (window) != 'undefined' &amp;&amp; window.XMLHttpRequest)
  return new XMLHttpRequest(); /* IE7, Safari 1.2, Mozilla 1.0/Firefox, and Netscape 7 */
  else
  return new ActiveXObject('Microsoft.XMLHTTP'); /* WSH and IE 5 to IE 6 */
  } 
  
  
  function http_onreadystatechange(sender, callback) {
  if (sender.readyState == /* complete */4) {
  var response = sender.status == 200 ?
  JSON.parse(sender.responseText) : {};
  response.xmlHTTP = sender;
  callback(response);
  }
  if (sender.readyState == 2 || sender.readyState == 3) {
  }
  } 
  
   function setupHeaders(http, method) {
  http.setRequestHeader('Content-Type', 'text/plain; charset=utf-8');
  http.setRequestHeader('X-JSON-RPC', method);
  }
  </code></pre>
  
  <p>It returns the following response when running under classic mode: -</p>
  
  <pre><code>"{"id":0,"result":{"serverInfo":{"totalCount":2,"serviceName":"FluorineFx.PageableResult","version":1,"cursor":1,"id":null,"columnNames":["ApplicationId","ApplicationParentID","ParentApp","ChildApp"],"initialData":[[1158,1153,"Apps","App_Application1"],[3159,3161,"Databases","DB_Database1"]]}}}"
  </code></pre>
  
  <p>Whereas, it returns following when running under integrated mode : -</p>
  
  <pre><code>"
  
  
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
  
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  
  &lt;head&gt;&lt;title&gt;
  
  
  
  &lt;/title&gt;&lt;/head&gt;
  
  &lt;body&gt;
  
      &lt;form method="post" action="xxxxx...." id="form1"&gt;
  
  &lt;div class="aspNetHidden"&gt;
  
  &lt;input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEXXXXLTE2MTY2ODcyMjlkZLGuNeIyaZaly9gcTafYavVTQG2payFqxE2OaB+1PjxT" /&gt;
  
  &lt;/div&gt;
  
  
  
      &lt;div&gt;
  
  
  
      &lt;/div&gt;
  
      &lt;/form&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  
  "
  </code></pre>
  
  <p>Due to above response it fails inside http_onreadystatechange() method in this line: -</p>
  
  <pre><code>var response = sender.status == 200 ?
  JSON.parse(sender.responseText) : {};
  </code></pre>
  
  <p>My issue is that why does it returns weird response when running under integrated mode?</p>