I'm trying to understand the meaning of raw POST data. The PHP manual page for $HTTP_RAW_POST_DATA
just state that this variable contains Raw POST data
.
When will this variable be set and what's the meaning of raw POST data?
I understand the $_POST
, but I am totally confused with $HTTP_RAW_POST_DATA
.
HTTP is a text-based protocol, so all the data is passed as a strings. When you work with $_POST
- you already have the passed data processed for you to be in an array form. This is done by PHP automatically right before the control is passed to your script.
So in the raw POST data there is data as it was passed through the network.
Likely you see a=1&b=2
data, as you see it in URLs.
$HTTP_RAW_POST_DATA
contains the raw POST data like in the following formats:
In general, php://input
should be used instead of $HTTP_RAW_POST_DATA.
because this feature has been DEPRECATED as of PHP 5.6.0. Relying on this feature is highly discouraged.
Source: php.net - $HTTP_RAW_POST_DATA
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With