Skip to content

Instantly share code, notes, and snippets.

@szabacsik
Created January 8, 2018 14:18
Show Gist options
  • Save szabacsik/db40aaba21bb91e871f912cc9dbed7c3 to your computer and use it in GitHub Desktop.
Save szabacsik/db40aaba21bb91e871f912cc9dbed7c3 to your computer and use it in GitHub Desktop.
Get raw data from the request body
$json_string = file_get_contents ( 'php://input' );
$object = json_decode ( $json_string );
var_export ( $object );
//http://php.net/manual/en/wrappers.php.php
//https://stackoverflow.com/questions/2731297/file-get-contentsphp-input-or-http-raw-post-data-which-one-is-better-to
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment