User Contributed Notes
lphuberdeau at phpquebec dot org11 years ago
Since HTTP_RAW_POST_DATA requires a configuration to be generated and is not enabled as a default value, you will probably have to use the PHP STDIN stream to get the raw data. It's probably better to use this method as the raw data will not be generated every time, even when not needed.
<?php
$fp = fopen( "php://stdin", "r" );
$data = '';
while( !feof( $fp ) )
$data .= fgets( $fp );
fclose( $fp );
?>
Darkener Daemon EX10 years ago
"php://stdin" doesn't exist in my PHP version. I use the following code block instead :
<?php
if (!isset($HTTP_RAW_POST_DATA))
$HTTP_RAW_POST_DATA = file_get_contents("php://input");
?>