Does the HTTP Protocol stipulate that the POST content must be submitted in the form of a key-value pair? Direct POST string, PHP $ _ POST cannot receive it. Is there any way for PHP to receive the POST string? Does the HTTP Protocol stipulate that the POST content must be submitted in the form of a key-value pair? Direct POST string, PHP $ _ POST cannot receive it. Is there any way for PHP to receive the POST string?
Reply content:
Does the HTTP Protocol stipulate that the POST content must be submitted in the form of a key-value pair? Direct POST string, PHP $ _ POST cannot receive it. Is there any way for PHP to receive the POST string?
Do you want this?
php://input
If you haven't touched php for many years, you can find it intuitively. Maybe it's what you want: http://php.net/manual/en/reserved.variables.httprawpostdata.php.
1. By default, POST is an array of k-v. 2. You need to use php: // input.
$ GLOBALS ["HTTPRAWPOSTDATA "] or fileGet_contents ('php: // input ');
By default, the Content-Type of the POST request generated by HTML is application/x-www-form-urlencoded, which is a form in the key-value format that we understand.
However, since Content-Type exists, it can be of another Type in the HTTP protocol! For example, application/json, text/plain. Of course, how to deal with the server end is a matter of the server.