title: Ajax JSON.stringify, POST variable is empty
body: <p>I'm trying to serialize an HTML form and to send it via Jquery with a POST action, currently I have the following Jquery:</p>
  
  <pre><code>var dataToSend = {
                      'name': 'person',
                      'description': 'very nice person'
                  }
  
                  $.ajax({
                      type: "POST",
                      url: "http://localhost/rest/PersonPOST.php",
                      data: JSON.stringify(dataToSend)
                      //contentType: 'application/json',
                      //dataType: 'json'
                  });
  </code></pre>
  
  <p>on the server side I have a PHP script which prints what it receives, so far I managed to receive a request without the $_POST variable.
  If I decomment contentType and dataType nothing changes...</p>
  
  <pre><code>&lt;?php
  
  error_log("START POST");
  foreach ($_POST as $key =&gt; $entry)
  {
      if (is_array($entry))
      {
          foreach ($entry as $value)
          {
              error_log($key . ": " . $value . "&lt;br&gt;");
          }
      }
      else
      {
          error_log($key . ": " . $entry . "&lt;br&gt;");
      }
  }
  
  ?&gt;
  </code></pre>
  
  <p>What is wrong with the above ajax request?</p>
  
  <p><strong>EDIT</strong>: file_get_contents('php://input') at the server side correctly prints the content which should be inside $_POST variable. Can anyone answer how to normally put this inside the $_POST variable or why it's not possible? thank you</p>