回复内容: http协议是否有规定,post过来的内容必须以键值对的形式提交?直接post字符串,php的$_post没有办法接收的到,请问有什么办法能让php接收到post过来的字符串呢?
想要是是这个吗?
php://input
很多年没碰php了,直觉上肯定是可以的,这个也许是你想要的:http://php.net/manual/en/reserved.variables.httprawpostdata.php
1.默认情况下 post 是 k-v 的数组2.你的情况需要用 php://input
$globals[httprawpostdata]或者fileget_contents('php://input');
默认情况下 html 产生的 post 请求的 content-type 是 application/x-www-form-urlencoded,也就是我们理解的 key-value 形式的表单。
但是,既然有 content-type,那么就 http 协议来说它可以是其它类型的!比如 application/json,比如 text/plain。当然服务器那头怎么处理就是服务器的事情了。
