|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-05-06 22:49 UTC] jeff at nokrev dot com
[2006-05-07 16:17 UTC] iliaa@php.net
[2006-05-15 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 09:00:01 2025 UTC |
Description: ------------ When making a PHP request, if the Content-type request header is undefined, $HTTP_RAW_POST_DATA is empty (or undefined, depending on the related ini setting). Reading from the input stream works correctly, and will read all content if the content-type is set or not. Reproduce code: --------------- <?php /* PRINT DEBUG INFO */ // Request method echo "Request Method: ".$_SERVER['REQUEST_METHOD']."\n"; // HTTP_RAW_POST_DATA echo "HTTP_RAW_POST_DATA: ".$HTTP_RAW_POST_DATA."\n"; // Input socket $inputSocket = fopen('php://input','rb'); $contents = stream_get_contents($inputSocket); fclose($inputSocket); echo "Input socket: ".$contents."\n"; ?> Expected result: ---------------- When Content-type request header not sent: Request Method: POST HTTP_RAW_POST_DATA: Input socket: post_contents Actual result: -------------- It should be the same as if reading from the input stream: Request Method: POST HTTP_RAW_POST_DATA: post_contents Input socket: post_contents