略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: $HTTP_RAW_POST_DATA

2024-04-25

$HTTP_RAW_POST_DATA

$HTTP_RAW_POST_DATA原生POST数据

说明

Warning

This feature was DEPRECATED in PHP 5.6.0, and REMOVED as of PHP 7.0.0.

$HTTP_RAW_POST_DATA 包含 POST 提交的原始数据。参见 always_populate_raw_post_data

一般而言,使用 php://input 代替 $HTTP_RAW_POST_DATA

add a note add a note

User Contributed Notes 3 notes

up
67
Ray dot Paseur at GMail dot com
9 years ago
To get the Raw Post Data:

<?php $postdata = file_get_contents("php://input"); ?>

Please see the notes here:
http://us.php.net/manual/en/wrappers.php.php
up
47
Ricardo Martins
6 years ago
what is exaclty raw POST data?

Answer:

$_POST can be said as and outcome after splitting the $HTTP_RAW_POST_DATA, php splits the raw post data and formats in the way we see it in the $_POST For example:

    $HTTP_RAW_POST_DATA looks something like this

key1=value1&key2=value2

    then $_POST would look like this:

$_POST = array(
    "key1" => "value1",
    "key2" => "value2",);
up
-45
Ray.Paseur Sometimes Uses Gmail
4 years ago
At PHP 5.6+ you can suppress the Deprecated messages by setting:

always_populate_raw_post_data = -1

More information here: https://bugs.php.net/bug.php?id=66763

官方地址:https://www.php.net/manual/en/reserved.variables.httprawpostdata.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3