我该如何使用PHP读取请求负载(POST)的内容? 我正在使用Angular应用程序发送POST请求。 我尝试过使用:$_POST,$_FILES和file_get_contents('php://input') ... 但都没有起作用。
如果您需要查看x-www-form-urlencoded的POST数据,只需使用以下代码:print_r($_POST); 如果您需要查看JSON post数据,请使用以下方法:$data=json_decode(file_get_contents('php://input'),1); print_r($data);