In the HTTP protocol, the POST method is used to submit data to the server, which is described in four ways:
- application/x-www-form-urlencoded
- Multipart/form-data
- Application/json
- Text/xml
Because it works under the HTTP protocol, here's what the HTTP protocol looks like.
features of the HTTP protocol :
- It is recommended that the application layer above TCP/IP be transmitted by ASCII code;
- The HTTP request is divided into three parts, the request request line, the message header, the message body, where the message header and the body of the message are separated by a blank line (CR/LF):
<method> <request-URL> <version>
The Protocol stipulates that post submission data needs to be placed in the body of the message, but is not qualified for encoding. The Content-type property in the message header can be used by the server to learn
The data encoding method, the article first said four kinds of ways, actually is four kinds of content-type.
First, content-type:application/x-www-form-urlencoded
The most common way, examples are as follows:
POST http://www.example.com http/1.1content-type:application/x-www-form-urlencoded;charset= utf-8title=test&sub%5b%5d=1&sub%5b%5d=2&sub%5b%5d=3
Not to be continued.
Main reference articles:
"1" four common POST-submission data ways by a drop in the sea
Four ways to submit data with the Post method of HTTP