Reprint: Detailed description http://www.jb51.net/web/12714.html
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.