HTTP defines the different methods of interacting with the server, the most commonly used are 4, get, Post, Put, delete, if I change the order is good to remember, Put (Increase), delete (delete), Post (change), Get (check), that is, add and delete changes, the following simple description:
1) Get, which is used to get information, note that he just gets and queries the data, that is, it does not modify the data on the server, from this point, it is data security, and later mentioned post it can modify the data, so this is one of the differences.
2) post, it is possible to send a modification request to the server, thus modifying the server, for example, we want to post on the forum, commenting on the blog, this will be used to post, of course, it can only get the data.
3) Delete Deletes the data. Can be achieved by get/post. Use not much, temporarily not much write, later expand.
4) Put, add, place data, can be achieved by get/post. Use not much, temporarily not much write, later expand.
Here's a brief look at the Get and post differences:
1) The data for the GET request is placed in the HTTP header, which is followed by the URL, usually as defined in the following format ( and post is the submitted data in the HTTP body ).
Login.action?name=hyddd&password=idontknow&verify=%e4%bd%e5%a5%bd
A, to? To separate URLs and data;
B, with & to separate the parameters;
C, if the data is English or digital, sent as is;
D, if the data is in Chinese or other characters, it is BASE64 encoded.
2) Get submitted less data, up to 1024B, because the get data is attached to the URL, and the URL will be subject to different circumstances, such as IE limit to 2k+35, and post can transmit more data (theoretically unlimited, but generally will be affected by different environments, such as browser, operating system, server processing power limit, IIS4 can support 80KB,IIS5 can support 100KB).
3) post security is higher than get, because the parameter data is transmitted in clear text when get, and can also cause Cross-site request forgery attack using get. The post data can be encrypted, but get may be faster.
So, summarize the following table:
|
Operation mode |
Data location |
Vmcontext |
Data security |
Length limit |
Application Scenarios |
|
GET |
HTTP Header |
Plaintext |
Not safe |
Small length |
Querying data |
|
POST |
HTTP body |
Can be clear and dense |
Safety |
Supports large data transfer |
modifying data |
The difference between HTTPS and HTTP