The difference between GET and POST:

The difference between GET and POST

   1、GET请求的数据是放在HTTP包头中的,也就是URL之后,通常是像下面这样定义格式的:
  login.action?name=hyddd&password=idontknow&verify=%E4%BD%E5%A5%BD 

Among them, use? To separate URL and data; use & to separate parameters; if the data is in English or numbers, send it as is; if the data is in Chinese or other characters, then perform BASE64 encoding.
And Post puts the submitted data in the HTTP body.
2. The data submitted by GET is relatively small, up to 1024B, because the GET data is attached to the URL, and the URL will be restricted by different environments. For example, IE limits it to 2K+35, while POST can send more (Theoretically, there is no limit, but it is generally limited by different environments, such as browsers, operating systems, server processing capabilities, etc. IIS4 can support 80KB, IIS5 can support 100KB).
3. The security of Post is higher than that of Get, because when Get, parameter data is transmitted in plain text, and parameters are directly exposed in the URL, so it cannot be used to transmit sensitive information. Moreover, using GET may also cause a Cross-site request forgery attack. The POST data can be encrypted, but the GET speed may be faster.
4. Get requests can only be url-encoded, and post supports multiple encoding methods; get requests will be actively cached by the browser, while post supports multiple encoding methods; get request parameters will be completely retained in the browsing history, while post The parameters will not be retained.
5. GET and POST are essentially TCP links, and there is no difference. However, due to HTTP regulations and browser/server restrictions, they show some differences in the application process.
6. GET generates one TCP data packet; POST generates two TCP data packets. For GET requests, the browser will send the http header and data together, and the server will respond with 200 (return data); for POST, the browser will first send the header, the server will respond with 100 continue, the browser will send data, and the server will respond. 200 ok (return data).

Guess you like

Origin blog.csdn.net/XRTONY/article/details/114780160