title: POST json data via ajax sends an empty array
body: <p>I'm trying to post data via ajax, this is my info:</p>
  
  <pre><code>    var jsondata =
                  {"address" : [
                  { "id": addid, "streetaddress": streetaddress, "city": city, "state": state,  "zipcode": zipcode, "latitude": latitude},
              ]   
              };  
  
      var jsontosend = JSON.stringify(jsondata, null, 2);
  </code></pre>
  
  <p>ajax function:</p>
  
  <pre><code>    $.ajax({
                  type: "POST",
                  url: "process.php",
                  contentType: "application/json; charset=utf-8",
                  dataType: "JSON",
                  data: jsontosend,
                  success: function(msg){
                     alert(msg);
                            }
               });
  
              return false;
  
              alert('Data sent');
  </code></pre>
  
  <p>}</p>
  
  <p>on the php end, when i print_r($_POST) it just says </p>
  
  <pre><code>    array(0) {
      }
  </code></pre>
  
  <p>I'm alerting (jsontosend) and its showing me everything perfectly, as well as in firebug using post mothod, its showing all the params sent in a perfect clean manner.  </p>
  
  <p>The only way it passes any data is if I use GET method.  </p>
  
  <p>Any advice is greatly appreciated!</p>
  
  <p>EDIT:  adding POST data from firebug.
  this is whats being alerted from the alert function:</p>
  
  <pre><code>    {"address":[{"id":1473294,"streetaddress":"3784 Howard Ave","city":"Washington DC","state":"DC","zipcode":20895,"latitude":39.027820587}]}
  </code></pre>
  
  <p>this is what firebug is showing as whats being passed when using POST method:</p>
  
  <pre><code>    myData=%7B%0A++++%22address%22%3A+%5B%0A++++++++%7B%0A++++++++++++%22id%22%3A+76076%2C%0A++++++++++++%22streetaddress%22%3A+%223784+Howard+Ave%22%2C%0A++++++++++++%22city%22%3A+%22Washington+DC%22%2C%0A++++++++++++%22state%22%3A+%22DC%22%2C%0A++++++++++++%22zipcode%22%3A+20895%2C%0A++++++++++++%22latitude%22%3A+39.027820587%0A++++++++%7D%0A++++%5D%0A%7D
  </code></pre>
  
  <p>and this is the response for var_dump of $_POST:</p>
  
  <pre><code>    array(0) {
  </code></pre>
  
  <p>}</p>
  
  <p>this is a var_dump of $_POST['myData']</p>
  
  <pre><code>    NULL
  </code></pre>