Differences between HTTP get and post Methods

Source: Internet
Author: User
Tags html header

1. get is to add the parameter data queue to the url indicated 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.

Post is to place each field in the form and its content in the HTML header Through the HTTP post mechanism and send it to the URL address referred to by the action attribute. You cannot see this process.

2. For the get method, the server uses Request. QueryString to obtain the variable value.

Post method. The server uses Request. Form to obtain submitted data. You can use Request to obtain parameters in either of the two methods.

3. The data volume transmitted in get mode is very small, generally around 2 kb, but the execution efficiency is better than the post method.

The data volume transmitted by the post method is relatively large. It is waiting for the server to read data, but there are also byte restrictions to avoid malicious attacks against the server with a large amount of data.

4. Low get security and high post security.

Data submitted in get mode may cause security issues. For example, when you log on to the page and submit data in get mode, the user name and password will appear in the URL. If the page can be cached

Or others can access this machine to obtain the user's account and password from the history. Therefore, form submission uses the post method.

Of course, it is not absolutely safe to submit data in post mode. If an HTTP request is intercepted, you can still view the submitted information from the request header,

Most requests must be encrypted.

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.