Get and Post are both requests to the server, but the sending mechanism is different.
1. A GET request passes parameters after the URL, while a POST request is sent to the WEB server as the physical content of an HTTP message. In Ajax requests, of course, this distinction is not visible to the user.
The maximum number of bytes that can be submitted by GET is 1024 bytes. The maximum number of bytes that can be submitted by GET is 1024 bytes. In fact, URL does not have the problem of parameter upper limit, HTTP protocol specification does not limit URL length. This restriction is restricted by specific browsers and servers. Internet Explorer limits the URL length to 2083 bytes (2K+35). For other browsers, such as Netscape, FireFox, etc., there is theoretically no length limit, which depends on the operating system support. Note that this is limited to the entire URL length, not just your parameter value data length.
3. The data requested in GET mode is cached by the browser, so that others can read the data, such as the account and password, from the browser history. In some cases, the GET approach can cause serious security problems. POST avoids these problems.
The difference between get and POST on the server side:
4. When the client makes a GET Request, the server uses Request.QueryString to obtain parameters. When the client makes a POST Request, the server uses Request.Form to obtain parameters.
The HTTP standard includes these two methods for different purposes. POST is used to create a resource, and the content of the resource is compiled into the CONTENT of the HTTP request. For example, processing order forms, adding new data rows to a database, and so on.
The GET method is used when the request has no side effects (such as a search); The POST method is used when the request has side effects, such as adding rows of data. A practical problem is that the GET method can produce very long urls, perhaps exceeding the URL length limits imposed by some browsers and servers.
The POST method is used if any of the following conditions occur:
* The result of the request has persistent side effects, such as adding new rows to the database.
* If you use the GET method, the data collected on the form may make the URL too long.
* The data to be transmitted is not 7-bit ASCII.
The GET method is used if any of the following conditions are true:
* Requests are made to find resources, and HTML form data is used only to aid the search.
* Request results have no lasting side effects.
* The total length of the collected data and input field names in the HTML form should not exceed 1024 characters.