Generally we use $_post or $_request two predefined variables to receive post-submitted data. However, if the submitted data does not have a variable name, but rather a direct string, then it needs to be received in other ways.
Method One: Use the global variable $globals[' http_raw_post_data '] to get.
The $globals[' Http_raw_post_data ' store is the raw data that is sent to the POST. $_post or $_request, however, stores the data in PHP in the form of a key=>value format. But whether or not the data in $globals[' Http_raw_post_data ' is saved depends on the settings of the Centent-type, that is, the post data must be explicitly indicated content-type:application/ X-www-form-urlencoded,post data is stored in the $GLOBALS [' Http_raw_post_data '].
Method Two: Use File_get_contents ("Php://input") to obtain.
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 can be used for any data that is received by the post in PHP. Regardless of the Content-type, including binary file streams is also possible. So using method Two is the most insurance method.
How PHP Gets the raw data for post