Difference between get and post Methods

Source: Internet
Author: User
Tags html header alphanumeric characters

There are 5 Differences Between get and post methods in Form submission.

1. Get is to get data from the server, and post is to send data to the server.
2. Get refersParametersThe data queue is added to the URL referred to by the Action attribute of the submitted form. The values correspond to each field in the form one by one and can be seen in the URL. By using the httppost mechanism, each field in the form and its content are placed in the HTML header and transmitted to the URL address referred to by the Action attribute. You cannot see this process.
3. For the get method, the server uses request. querystring to obtain the value of the variable. For the POST method, the server uses request. Form to obtain the submitted data.
4. The data volume transmitted by get is small and cannot exceed 2 kb. The amount of data transmitted by post is large, which is generally not restricted by default. Theoretically, the maximum size of IIS4 is 80 KB, and that of iis5 is 100kb.
5. Low get security and high post security.

HTTP Request: difference between get and post Methods

HTTP defines different methods for interaction with the server. The most basic methods are get and post. In fact, get applies to most requests, while retaining post is only used to update sites. According to the HTTP specification, get is used to obtain information, and should be secure and idempotent. The so-called security means that this operation is used to obtain information instead of modifying information. In other words, get requests generally do not have side effects. Idempotence means that multiple requests to the same URL should return the same result. The complete definition is not as strict as it looks. Basically, the goal is that when a user opens a link, she can be confident that the resource has not changed from her own perspective. For example, the front pages of news sites are constantly updated. Although the second request will return a different batch of news, this operation is still considered safe and idempotent because it always returns the current news. And vice versa. POST requests are not that easy. Post indicates a request that may change resources on the server. Taking news sites as an example, the comments of articles should be implemented through post requests, because the site is different after the annotation is submitted (for example, an annotation is displayed below the article);
when the form is submitted, if the method is not specified, the GET request is used by default, the data submitted in form will be appended to the URL? Separated from the URL. Alphanumeric characters are sent as they are, but spaces are converted to "+". Other symbols are converted to % XX, where XX is the ASCII (or ISOLatin-1) value of the symbol in hexadecimal notation. The data to be submitted for get requests is placed in the HTTP Request Header, while the data to be submitted by post is placed in the object data.
the data to be submitted in get mode can only contain 1024 bytes at most, post does not have this restriction.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.