application/x-www-form-urlencoded
$_REQUEST、
$_POST、file_get_contents('php://input')、
$GLOBALS['HTTP_RAW_POST_DATA']
普通字符串
(如:json字符串、xml字符串)
file_get_contents('php://input')、
发送用户数据的地方:
url:查询字符串,始终以get方式发送
html表单:查询字符串、文件,发送文件必须设置编码器类型为multipart/form-data
ajax:查询字符串、json字符串、xml字符串、FormData对象(包含文件)
fetch:查询字符串、json字符串、xml字符串、FormData对象(包含文件)
curl:查询字符串、json字符串、xml字符串、数组(包含文件)
发送的数据要进行url编码:
url的编码规则不同浏览器采用不同的编码规则
表单数据的编码规则同页面编码
ajax数据的编码规则同页面编码
curl数据的编码规则同页面编码
说明:
file_get_contents('php://input')、$GLOBALS['HTTP_RAW_POST_DATA']接收的条件:application/x-www-form-urlencoded和post。
上一篇:php中使用curl发送请求
下一篇:js、php、thinkphp获取当前url