title: Unable to read POST'd data using $.ajax
body: <p>I have a super simple JS code that POSTs to my local server. Both JS and PHP are on localhost so I'm not worrying about cross site issues at the moment. Here's my JS:</p>
  
  <pre><code>var ENDPOINT_BASE = '';
  var ENDPOINT_USER_LOGIN    = { url: '/user/login',    method: 'POST'};
  var ENDPOINT_USER_REGISTER = { url: '/user/register', method: 'POST'};
  
  var toSend = {'credentials': { 'email':'1', 'password':'123'}};
  
  $.ajax({
      method: ENDPOINT_USER_LOGIN.method,
      url: ENDPOINT_BASE + ENDPOINT_USER_LOGIN.url,
      contentType: "application/json",
      data: toSend
  });
  </code></pre>
  
  <p>My PHP is simply:</p>
  
  <pre><code>&lt;?php
  print_r($_POST);
  </code></pre>
  
  <p>In the Chrome debugger I can see the network call be made, however the Response received in <code>$_POST</code> is always empty, ie it prints out <code>Array()</code>.</p>
  
  <p>If I add something like <code>echo "abc";</code> in the PHP I can see it in the response, so it is hitting that URL correctly.</p>
  
  <p>I'm using jQuery 2.1.4.</p>
  
  <p>The JS console isn't printing out any error messages.</p>
  
  <p>Any ideas what could be wrong? Thanks!</p>