Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/261.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在PHP中获取原始请求?_Php_Api_Post_Request - Fatal编程技术网

如何在PHP中获取原始请求?

如何在PHP中获取原始请求?,php,api,post,request,Php,Api,Post,Request,我的服务器上有一个名为api.php的脚本。我使用POST请求从其他服务器调用它。有什么方法可以在我的api.php中获取POST请求的原始内容吗?使用以下代码 $data = file_get_contents('php://input'); 有关POST multipart data的信息,请参见。使用apache with php 5.5在xampp上返回空字符串:/

我的服务器上有一个名为api.php的脚本。我使用POST请求从其他服务器调用它。有什么方法可以在我的api.php中获取POST请求的原始内容吗?

使用以下代码

$data = file_get_contents('php://input');

有关POST multipart data的信息,请参见。使用apache with php 5.5在xampp上返回空字符串:/