title: XHR Wrapper POST method not working
body: <p>Im trying to do a Wrapper XMLHTTPRequest in javascript. I did the GET method and it works fine, but when it comes to the POST method it gives me an error:</p>
  
  <blockquote>
    <p>POST <a href="http://127.0.0.1:8080/text2.txt" rel="nofollow noreferrer">http://127.0.0.1:8080/text2.txt</a> 405 (Method Not Allowed) </p>
    
    <p>XHR failed loading: POST "<a href="http://127.0.0.1:8080/text2.txt" rel="nofollow noreferrer">http://127.0.0.1:8080/text2.txt</a>".</p>
  </blockquote>
  
  <p>Im running a local http-server with node</p>
  
  <p>I have one week stuck in this problem and i would really like to know how i can get this to work</p>
  
  <p>This is my js code:</p>
  
  <pre><code>var wrapper = new XMLHttpRequest();
  var params = 'Name=Cesar';
  
  function getText2() {
      wrapper.open('POST', 'text2.txt');
      wrapper.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
      wrapper.onreadystatechange = function() {
          if (this.readyState == 4 &amp;&amp; this.status == 200) {
          document.getElementById('Name').value = this.responseText;
          }
      };
      wrapper.send(params);
  }
  </code></pre>
  
  <p>And this is my html document: </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;script src="XHR.js"&gt; &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
  
          &lt;h2&gt;WRAPPER&lt;/h2&gt;
  
          Name: &lt;input type="text" id="Name"/&gt;
  
          &lt;button type="button" onclick="getText2()"&gt;
          Post Test&lt;/button&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>