fidder模拟post提交到PHP遇到的问题

http头必须带上Content-type: application/x-www-form-urlencoded  之后 ,php 才能接收到post数据

 

1. 用php://input可以很便捷的取到原始POST数据
2. $HTTP_RAW_POST_DATA 仅在POST的Content-Type类型不为PHP识别时才有效
如通常通过页面表单提交后的POST数据,不能通过$HTTP_RAW_POST_DATA提取到。因其编码类型属性(enctype属性)为 application/x-www-form-urlencoded、multipart/form-data。
注:即使在页面内显性地改变enctype属性为PHP不可识别的类型,仍无效。因表单提交编码属性是表单限定,不可识别的类型将被认为按默认编码方式提交(即application/x-www-form-urlencoded)
3. $_POST仅当数据按 application/x-www-form-urlencoded 类型提交时才能实现PHP获取POST数据。

posted @ 2015-05-24 10:45  scofi  阅读(327)  评论(0)    收藏  举报