note 112509 added to function.http-get-request-body
| From: | jimfr06 at gmail dot com | Date: | Mon, 24 Jun 2013 22:11:38 +0000 |
| Subject: | note 112509 added to function.http-get-request-body | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-195340@lists.php.net to get a copy of this message | ||
@slave at codegrunt dot com
If you leave out Content-Length and have no Transfer-Encoding, your request is no longer valid.
RFC261 says at chapter 4.3:
"The presence of a message-body in a request is signaled by the inclusion of a Content-Length
or Transfer-Encoding header field in the request's message-headers."
Without those headers, the server has no way of figuring out what the length of the body is. For a
response, you could indicate it with a connection close, but obviously if you do that on a request
you will never get a response!
So, I assume the PhP behaviour you describe is OK as you cannot expect it to auto-magically repair
all sorts of broken requests!
@Tim Trinidad
Reading php://input or using http_get_request_body_stream() must be very similar.
The documentation says:
"This function can not be used after http_get_request_body_stream() if the request method was
another than POST."
So it looks very similar to what you describe. The documentation should then read:
"This function can not be used after http_get_request_body_stream() or reading php://input, if
the request method was another than POST."
----
Server IP: 69.147.83.199
Probable Submitter: 82.230.150.153
----
Manual Page -- http://php.net/manual/en/function.http-get-request-body.php
Edit -- https://master.php.net/note/edit/112509
Del: integrated -- https://master.php.net/note/delete/112509/integrated
Del: useless -- https://master.php.net/note/delete/112509/useless
Del: bad code -- https://master.php.net/note/delete/112509/bad+code
Del: spam -- https://master.php.net/note/delete/112509/spam
Del: non-english -- https://master.php.net/note/delete/112509/non-english
Del: in docs -- https://master.php.net/note/delete/112509/in+docs
Del: other reasons-- https://master.php.net/note/delete/112509
Reject -- https://master.php.net/note/reject/112509
Search -- https://master.php.net/manage/user-notes.php