我正在尝试使用PHP处理application/x-www-form-urlencoded
POST请求。客户以下列格式发送请求:
POST /index.php User-Agent: Android/4.0
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip
action=Settings&device_id=2112121&app_version=420
服务器的响应必须如下:
{
"action": "Settings",
"data": {
"entries": {
"service_enabled": "true"
}
},
"data_format": "json"
}
在服务器端对index.php
有任何想法吗?
答案 0 :(得分:-2)
试试这个$_POST = json_decode(file_get_contents("php://input"), true);