zoukankan      html  css  js  c++  java
  • $HTTP_RAW_POST_DATA 与$_POST

    出处:http://blog.163.com/gwo-cce@126/blog/static/325736492008101142422345/

    这是手册里写的

    总是产生变量包含有原始的 POST 数据。否则,此变量仅在碰到未识别 MIME 类型的数据时产生。不过,访问原始 POST 数据的更好方法是 php://input。$HTTP_RAW_POST_DATA 对于 enctype="multipart/form-data" 表单数据不可用。

    问题:    $HTTP_RAW_POST_DATA  == $_POST  吗?

    照手册所写 ,答案应该就为否。

    假如不一样的话,他们的区别是什么呢?

    我知道答案了,如下:

    The RAW / uninterpreted HTTP POst information can be accessed with:

       $GLOBALS['HTTP_RAW_POST_DATA']

    This is useful in cases where the post Content-Type is not something PHP understands (such as text/xml).

    也就是说,基本上$GLOBALS['HTTP_RAW_POST_DATA'] 和 $_POST是一样的。但是如果post过来的数据不是PHP能够识别的,你可以用 $GLOBALS['HTTP_RAW_POST_DATA']来接收,比如 text/xml 或者 soap 等等。

    PHP默认识别的数据类型是application/x-www.form-urlencoded标准的数据类型。

  • 相关阅读:
    四套读写方案
    如何保证ArrayList线程安全
    异常总结<经典例题>
    java.移位运算符
    java反射机制
    面试题:return和finally执行
    Spring_通过注解配置 Bean(1)
    Spring_通过 FactoryBean 配置 Bean
    Spring_通过工厂方法配置 Bean
    Spring_管理 Bean 的生命周期
  • 原文地址:https://www.cnblogs.com/perseverancevictory/p/4183801.html
Copyright © 2011-2022 走看看