Send JSON data to PHP using XMLHttpRequest w/o jQuery
问题 I am trying to send JSON data from a form using the XMLHttpRequest object. I can send the data using the following function. There are no errors displayed in FireBug and the JSON-data in the request is displayed well formed by FireBug. However, I send the data to echo.php , what simply returns the content: <?php print_r($_POST); print_r($_GET); foreach (getallheaders() as $name => $value) { echo "$name: $value\n"; } echo file_get_contents('php://input'); ?> The POST-array is always empty, but