I was wondering if there was a way to get at the raw HTTP request data in PHP running on apache that doesn\'t involve using any additional extensions. I\'ve seen the HTTP functi
Use the following php wrapper:
$raw_post = file_get_contents("php://input");
Try this:
$request = $_SERVER['SERVER_PROTOCOL'] .' '. $_SERVER['REQUEST_METHOD'] .' '. $_SERVER['REQUEST_URI'] . PHP_EOL;
foreach (getallheaders() as $key => $value) {
$request .= trim($key) .': '. trim($value) . PHP_EOL;
}
$request .= PHP_EOL . file_get_contents('php://input');
echo $request;
Do you mean the information contained in $_SERVER
?
print_r($_SERVER);
Edit:
Would this do then?
foreach(getallheaders() as $key=>$value) {
print $key.': '.$value."<br />";
}