WP_REST_Server::get_raw_data()
Retrieves the raw request entity (body).
Return
(string) Raw request data.
Source
File: wp-includes/rest-api/class-wp-rest-server.php
public static function get_raw_data() {
global $HTTP_RAW_POST_DATA;
/*
* A bug in PHP < 5.2.2 makes $HTTP_RAW_POST_DATA not set by default,
* but we can do it ourself.
*/
if ( ! isset( $HTTP_RAW_POST_DATA ) ) {
$HTTP_RAW_POST_DATA = file_get_contents( 'php://input' );
}
return $HTTP_RAW_POST_DATA;
}
Changelog
Version | Description |
---|---|
WP-4.4.0 | Introduced. |