The difference between get and post in HTTP

Source: Internet
Author: User

1, 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 POST request places the requested data in the package body of the HTTP request packet. The item=bandsaw above is the actual transfer data.

Therefore, the data for the GET request is exposed in the address bar, and the POST request does not.

2, the size of the transmitted data

In the HTTP specification, there is no limit to 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 you use a GET request, the transfer data is limited by the URL length.

In the case of post, it is theoretically not restricted because it is not a URL, but in fact each server specifies that the size of the post submission data is limited, and that Apache and IIS have their own configuration.

3. Security

The security of post is higher than get. The security here refers to real security, and unlike the security methods mentioned above, the security mentioned above is simply not modifying the server's data. For example, in the login operation, through the GET request, the user name and password will be exposed to the URL, because the login page is likely to be cached by the browser and other people to view the history of the browser, the user name and password is easy to get someone else. In addition, data submitted by get requests may also cause Cross-site request Frogery attacks

The difference between get and post in HTTP

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.