Form form submission Get/post method (a) Difference

Source: Internet
Author: User

Reprint: Detailed description

Get form: http://localhost:8080/servlet?msg= Hangzhou
Post form: Http://localhost:8080/servlet

1, get is used to obtain data from the server, post is used to pass data to the server.

2, the form of data transfer is different.
Get adds the data in the form, in variable=value form, to the URL that the action points to, and both uses the "?" Connection, while the "&" connection is used between the variables;
Post is where the data in the form is placed in the form's data body, and is passed to the URL of the action, in the same way as the variable and the value.

3, get pass the parameter is visible, post is not visible, post is more secure
Get is not safe, because in the transfer process, the data is placed in the requested URL, and many of the existing servers, proxy servers, or user agents will be the request URL to log files, and then put in a place, so that there may be some privacy information by a third party to see. In addition, users can also see the submitted data directly in the browser, some system internal messages will be displayed in front of the user.
All operations for post are not visible to the user.

4, get transmission of the small amount of data, post can transmit a large number of data
The amount of data being transmitted is small, which is mainly due to the URL length limitation;
Post can transmit a lot of data, so you can only use post for uploading files.

5, the supported character sets are different
The value of the data set of the Get restriction form form must be an ASCII character;
Post supports the entire ISO10646 character set. The default is to use ISO-8859-1 encoding

6, get is the default method for form.

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: 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.