This article describes the difference between get and post, for many students to understand the difference between the understanding is not very clear, then we today talk about the difference between get and post to the low there! Talk less and go straight to the chase!
1, the form of the request
GET request: The requested data is appended to the URL, to split the URL and transfer data, multiple parameters with & connection. The encoding format of the URL is encoded in ASCII rather than Uniclde, meaning that all non-ASCII characters are encoded before being transmitted.
POST request: The requested data is placed in the package body of the HTTP request packet.
For example, the following name=shuaige is the actual transfer data.
[Plain] View plain copypost/inventory-check.cgi http/1.1 host:www.joes-hardware.com content-type:text/ Plain content-length:18 item=shuaige 2647
2, the size of the transmitted data
Get request: In the HTTP specification, there is no limit on the length of the URL and the size of the data being transmitted. However, in the actual development process, for get, the specific browser and server to the length of the URL is limited. Therefore, when a GET request is used, the transmitted data is limited by the URL length, and generally the amount of data transmitted does not exceed 2KB
POST request: Because it is not a URL value, theoretically it is not limited, but in fact, each server will specify the post submission data size restrictions, Apache, IIS have their own configuration.
3. Security
GET request: The transport parameters are low security because the transmitted data is displayed in the URL, everyone is visible, and is cached and retained in the browser history.
POST request: The data is stored in the request packet for transmission, is not displayed in the URL, and the parameters are not cached and saved in the browser history or Web server logs.
4. Types of transmitted data
Get request: Only ASCII characters are allowed
POST request: Supports multiple data types
5, the impact on the server
GET request: Fetch data from the server, so-called check, just to get the server resources, not to modify.
POST request: Submits data to the server, which involves updating the data, that is, changing the server's data.
Related recommendations:
PHP implements the Get and post request step instances using Curl
Get and post differences in PHP