Phppost: several methods for retrieving post parameters submitted by php
1. $ _ POST ['paramname'] can only receive data submitted by Content-Type: application/x-www-form-urlencoded
2. file_get_contents ("php: // input") applies to most types of Content-type.
Php: // input allows reading original POST data. Compared with $ HTTP_RAW_POST_DATA, it puts less pressure on the memory and does not require any special php. ini settings. Php: // input cannot be used for enctype = "multipart/form-data ".
3. $ GLOBALS ['http _ RAW_POST_DATA ']; always generate the $ HTTP_RAW_POST_DATA variable containing the original POST data. This variable is generated only when data of the unrecognized MIME type is encountered. $ HTTP_RAW_POST_DATA is unavailable for enctype = "multipart/form-data" form data.
If the post data is not recognized by PHP, you can use $ GLOBALS ['http _ RAW_POST_DATA '] to receive the data, such as text/xml or soap.