Skip to content

Instantly share code, notes, and snippets.

@zacwasielewski
Created April 30, 2014 16:50
Show Gist options
  • Save zacwasielewski/552c6fb85b417a1b8693 to your computer and use it in GitHub Desktop.
Save zacwasielewski/552c6fb85b417a1b8693 to your computer and use it in GitHub Desktop.
How to process a JSON POST request in PHP
<?php
if ($_SERVER['REQUEST_METHOD']=='POST') {
$json = json_decode(@file_get_contents('php://input'));
print_r($json);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment