title: Can't send JSON as string via AJAX
body: <p>So I'm trying to send a JSON as a string.
  Then I have a PHP back-end that retrieves this JSON string and parses it using <code>json_decode</code>.</p>
  
  <p>Unfortunately, I can't get to send this JSON as a string.</p>
  
  <p>Here's the jQuery Ajax script I used:</p>
  
  <pre><code>var jsonString = JSON.stringify(checkables);
  console.log(jsonString);
  
  $.ajax({
      url: $url,
      type: 'POST',
      data: {ajaxidate: JSON.stringify(jsonString)},
      contentType: "application/json; charset=UTF-8",
      success: function (data)
      {
          // just successful callback
      },
      error: function ()
      {
          // just error callback
      }
  });
  </code></pre>
  
  <p>Variable <code>checkables</code> contains raw form as JSON data:
  <a href="https://i.stack.imgur.com/BRIZb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BRIZb.png" alt="checkables_data"></a></p>
  
  <p>After applying <code>JSON.stringify()</code>, this is now how it looks:
  <code>[{"name":"name","type":"multialphanumslug","value":"AD"},{"name":"server","type":"host","value":"10.1.1.1"},{"name":"port","type":"number","value":"8080"},{"name":"authid","type":"username","value":"barryallen"}]</code></p>
  
  <p>At the back-end, I have this PHP script:</p>
  
  <pre><code>&lt;?php
      var_dump($_POST);
      die();
  ?&gt;
  </code></pre>
  
  <p>Now I suppose $_POST at back-end should now contain this:</p>
  
  <p>array(
      'ajaxidate' => "[{\"name\":\"name\",\"type\":\"multialphanumslug\",\"value\":\"AD\"},{\"name\":\"server\",\"type\":\"host\",\"value\":\"10.1.1.1\"},{\"name\":\"port\",\"type\":\"number\",\"value\":\"8080\"},{\"name\":\"authid\",\"type\":\"username\",\"value\":\"barryallen\"}]"
  );</p>
  
  <p>But it didn't receive anything. Here's the captured request:</p>
  
  <p><a href="https://i.stack.imgur.com/BSfjQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BSfjQ.png" alt="enter image description here"></a></p>
  
  <p>The response from back-end?</p>
  
  <p><a href="https://i.stack.imgur.com/zXYtb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zXYtb.png" alt="enter image description here"></a></p>
  
  <p>I tried with POSTMan and I received an expected correct output:</p>
  
  <p><a href="https://i.stack.imgur.com/Cd1Z5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Cd1Z5.png" alt="enter image description here"></a></p>
  
  <p>Now that was ridiculous.</p>
  
  <p>I'm stuck at this for 2 days trying to figure out what's going on or what did I miss. Any help will be greatly appreciated.</p>