method One, $_post $_post or $_request is stored in PHP in the form of key=>value format after the data. method Two, using file_get_contents ("Php://input") For post data that does not specify Content-type, you can use File_get_contents ("Php://input") to get the raw data. In fact, this method is used for any data received by the post in PHP. Without considering Content-type, including binary file streams is also possible. Compared to $http_raw_post_data, it brings less pressure to memory and does not require any special php.ini settings. Php://input cannot read the post data content-type is multipart/form-data, you need to set the Always_populate_raw_post_data value in php.ini to ON. Php://input the _get data is not read. is because the $_get data is written as Query_path in the HTTP request header (header) of the path field, rather than written in the body portion of the HTTP request. method Three, use global variable $globals[' http_raw_post_data '] In $globals[' Http_raw_post_data ') The original data is stored in the POST. However, whether or not to save the POST data in $globals[' http_raw_post_data '] depends on the settings of the Centent-type, only if PHP is in an unrecognized content-type condition. The POST data is filled in the variable $globals[' Http_raw_post_data '], like content-type=application/x-www-form-urlencoded, The variable is empty. In addition, it is also unable to read the post data of Content-type to Multipart/form-data, but also to set the Always_populate_raw_post_data value in php.ini to ON, PHP will always fill in the post data into the variable $http_raw_post_data. |