[Post] What is the difference between post and get?

Source: Internet
Author: User
Tags html header

Difference between post and get

Isn't there a large string in the post address bar? Something like bjnghfgreygt

If it is get, it will appear

1. The get method uses a URL request to transmit user data. Each field name and its content in the form are connected to a pair of strings and placed as indicated by the Action attribute.ProgramAfter the URL, such as http://www.mdm.com/test.asp? Name = ASD & Password = sad, data will be directly displayed on the URL, just as the user clicks a link; the POST method uses the http post mechanism, place the field names and content in the form in the HTML header and send them to the server for processing by the program that can be referred to by the Action attribute. The program will pass the standard input (stdin) to read and process the form data.

2. The get method uses request. querystring to obtain the value of the variable. The post method uses request. Form to access the submitted content.

3. The size of data transmitted in get mode is very small, generally around 2 kb, but the execution efficiency is better than that of POST method. The size of data transmitted in post mode is relatively large, it is waiting for the server to read data, but there are also byte restrictions. This is to avoid malicious attacks on the server using a large amount of data. According to Microsoft, Microsoft uses request. the maximum data size that form () can receive is limited. In IIS 4, it is 80 KB, and in IIS 5, it is 100 kb.

Suggestion: unless you are sure that the data you submit can be submitted at one time, use the POST method whenever possible.

4. If you submit data in get mode, security issues may occur. For example, when you submit data in get mode on a login page, the user name and password will appear on the URL, if the page can be cached or other users can access the customer's machine, the user's account and password can be obtained from the history. Therefore, the POST method is recommended for form submission; A common problem on the form page submitted by the post method is that if the page is refreshed, a dialog box will pop up.

Suggestion: For security reasons, it is recommended that you use post to submit data.
 

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.