Get and Post are sent to the server a request, but the sending mechanism is different.
1. GET request will be passed in the parameter with the URL , while the POST request is sent as an entity of the content of the HTTP message to the WEB server. Of course, in the Ajax request, this distinction is not visible to the user.
2. The first is “GET method to submit the data can only be up to 1024 bytes”, because GET is submitted through the URL data, then GET can submit the amount of data just like the length of the URL has a direct relationship. In fact, the URL does not exist the upper limit of the problem, HTTP protocol specification does not limit the length of the URL. This restriction is limited by the specific browser and the server. IE limits the length of the URL to 2083 bytes (2K + 35). For other browsers, such as Netscape, FireFox, etc., there is no length limit in theory, and its limitations depend on the support of the operating system. Note that this is the length of the entire URL length, not just your parameter value data length .
3. GET method The requested data is cached by the browser , so others can read the data from the browser’s history, such as account numbers and passwords. In some cases, the GET approach can cause serious security problems . The POST method is relatively easy to avoid these problems.
get the difference between the request and the post request on the server side :
4. When the client uses the get request, the server uses Request.QueryString to get the parameters, and the client uses the post request, the server uses the Request.Form to get the parameters.
The HTTP standard contains these two methods for a different purpose. POST is used to create resources, the contents of the resource will be included in the contents of the HTTP request. For example, to process an order form, add new rows to the database, and so on. When the request for no side effects (such as search), you can use the GET method; when the request for side effects (such as adding data lines), then use the POST method . A more practical question is that the GET method may produce a long URL that may exceed the limits of the URL length of some browsers and servers.
If any of the following conditions are met, the GET method is used:
- The request is to find the resource, and the HTML form data is only used to help the search.
- Request results without persistent side effects.
- The total length of the collected data and the input field name within the HTML form does not exceed 1024 characters.
If any of the following conditions are met, the POST method is used:
- The result of the request has a persistent side effect, for example, adding a new row of data in 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 a 7-bit ASCII code.