title: Sending PUT/DELETE data with a XMLHttpRequest
body: <p>I used the example from <a href="https://stackoverflow.com/questions/9713058/sending-post-data-with-a-xmlhttprequest/19839873#19839873">Send POST data using XMLHttpRequest</a> to create this JavaScript code:</p>
  
  <pre><code>function PostXML(webURL, post_data) {
      var objHTTP = new ActiveXObject("MSXML2.XMLHTTP");
      objHTTP.open("POST", webURL, false);
      objHTTP.setRequestHeader("Content-Type", "application/xml; charset=utf-8");
      objHTTP.setRequestHeader("Accept", "application/xml; charset=utf-8");
      objHTTP.setRequestHeader("Content-Length", post_data.length);
      objHTTP.send(post_data);
  
      while((objHTTP.readyState != 4) &amp;&amp; (objHTTP.readyState != 'complete')) {
          Delay(100);
      }
  
      if(200 != objHTTP.Status) {
          Log.Message("Returned Status Code of: " + objHTTP.Status);
          Log.Message("Status Text: " + objHTTP.StatusText);
      }
      else {
          Log.Message("Returned Status Code of: " + objHTTP.Status);
      }
  
      return objHTTP.responseText;
  }
  </code></pre>
  
  <p>I also need to <code>PUT</code> and <code>DELETE</code> stuff. How do I transfer this code to be able <code>PUT</code>, and how do I transfer this code to be able to <code>DELETE</code>?</p>
  
  <p>Any other examples which work the same is fine too.</p>