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数据。

相关文章:

  • 2022-12-23
  • 2021-09-16
  • 2021-05-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2021-04-19
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-18
  • 2021-04-07
  • 2021-10-11
  • 2022-12-23
  • 2021-11-16
相关资源
相似解决方案