In the HTTP protocol, there are some differences between post requests and get requests, just some of them. Confused for a while, the novice can avoid the pit.
The format of the transfer of parameters:
Post
The request parameter in the POST request is passed in the request body, which is plainly the content.
This is passed in the "name=abc&password=123" request body.
Get
The request parameter in a GET request is passed in the form of a URL concatenation (request line) (http://www.bilchin.com/message?name=abc&password=123)
Note that the parameters must be noted, there are no spaces and other characters will cause ambiguity, so to the end of the stitching of the URL urlencode.encode () coding Oh.
--------------------------------------------------------------------------------------------------------
2. Usage scenarios:
Post
Let me just say, "post" and "get" are the equivalent of the database "add" and "check",
We do not want the information to be disclosed when we need to upload the user information and this is an "increase" operation, so use the POST request,
Get
Similarly, (a music player) when we click the Play button, we need to find this audio file to play, did not say you want to hide the file name with others, right? Http://www.bilchin.com/message?song= you are my beloved girl. mp3
--------------------------------------------------------------------------------------------------------
3. Parameter size limit
Post:
Can pass the content of large parameters (user feedback information does not count?) )
Get:
If you use the Get method, you are constrained by a length of 2048 bytes, minus the number of characters in the actual path.
(Note: The actual string length that can be used =2048-Request page path character length)
--------------------------------------------------------------------------------------------------------
These 3 points are clear and basically can meet your needs, and others you further study it yourself.
It's 0:16, so sleepy,!!!!!!!!!.
This article is from the "sharing is the best memory" blog, please be sure to keep this source http://elyar.blog.51cto.com/9864306/1766944
Learning note sharing (1), the way the post is sent in the HTTP protocol and the Get mode