title: AJAX request submits, but doesn't recieve POST values
body: <p>I am working on something and I have a very weird problem. I submit an AJAX request like following:</p>
  
  <pre><code>x = new XMLHttpRequest();
  x.open('POST', url, true);
  x.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
  x.onload = function(){
      console.log(x.responseText);
  };
  x.send(data);
  </code></pre>
  
  <p>The problem is, when I submit the request, the PHP doesn't receive the <code>POST</code> values. The <code>data</code> variable looks like following:</p>
  
  <pre><code>Object { wordtype: "noun", word: "computer" }
  </code></pre>
  
  <p>And the PHP like following:</p>
  
  <pre><code>if(!isset($_POST['wordtype']) || !isset($_POST['word'])){
      echo "error 1";
      exit;
  } else {
      $wordlist = json_decode(file_get_contents("words.json"), true);
      $wordlist[$_POST['word']] = $_POST['wordtype'];
      file_put_contents("words.json", json_encode($wordlist));
      echo "success";
  }
  </code></pre>
  
  <p>The value of <code>x.responseText</code> is always <code>error 1</code>;</p>
  
  <p>Thank You<br/>
  Jacques Marais</p>