title: Asmx webservice Xmlhttprequest content-type
body: <p>I have a piece of javascript code for accessing a asmx webservice</p>
  
  <pre><code>var xml = 'xml=&amp;lt;Webservice&amp;gt;&amp;lt;Parameters&amp;gt;&amp;lt;Parameter name=&amp;quot;PARTCODE&amp;quot; value=&amp;quot;WSA10029&amp;quot; /&amp;gt;&amp;lt;/Parameters&amp;gt;&amp;lt;/Webservice&amp;gt;';
          try {
              xhr = new XMLHttpRequest();
              xhr.open('POST', url, false);
              xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
              xhr.onreadystatechange = function () {
                  if (xhr.readyState == 4 &amp;&amp; xhr.status == 200) {
                      alert(xhr.responseText);
                  }
              };
              xhr.send(xml);
          } catch (e) {
              alert('Error occured in XMLHttpRequest: ' + xhr.statusText + '  ReadyState: ' + xhr.readyState + ' Status:' + xhr.status);
          }
  </code></pre>
  
  <p>The webservice receives the request but the parameter xml is empty at the webservice side. i've tried many different Content-Types but none of them work.</p>
  
  <p>Data data I want to send is xml, therefor I htmlencoded the xml. </p>