Like php://input and http_get_request_body_stream(), http_get_request_body() doesn't seem to work with enctype="multipart/form-data".
http_get_request_body
(PECL pecl_http >= 0.10.0)
http_get_request_body — リクエストの本文を文字列として取得する
説明
string http_get_request_body
( void
)
生のリクエスト本文 (例: POST あるいは PUT データ) を取得します。
リクエストメソッドが POST 以外の場合は、 http_get_request_body_stream() の後にこの関数を使用することはできません。
パラメータ
返り値
成功した場合は生のリクエスト本文を文字列で返します。 失敗した場合は NULL を返します。
参考
- http_get_request_body_stream() - リクエストの本文をストリームとして取得する
- http_get_request_headers() - リクエストヘッダを配列として取得する
- PHP 5.1.0 以降を使用している場合は HttpResponse クラス
http_get_request_body
neil at foo dot co dot za
29-Feb-2008 09:40
29-Feb-2008 09:40
osborn dot steven at gmail dot com
23-Aug-2007 06:01
23-Aug-2007 06:01
For those of you without the HTTP extension, try:
<?php
$body = @file_get_contents('php://input');
?>
