ID: 37342 User updated by: jeff at nokrev dot com Reported By: jeff at nokrev dot com Status: Open Bug Type: Streams related PHP Version: 5.1.4 New Comment:
Also, this is not being called called by a form. The content- type is not multipart/form-data, so please do not suggest that. Previous Comments: ------------------------------------------------------------------------ [2006-05-06 22:35:31] jeff at nokrev dot com 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37342&edit=1