Difference between GET and POST, difference between GETPOST

Source: Internet
Author: User

Difference between GET and POST, difference between GETPOST
What is the difference between GET and POST?
1. Whether the address bar is displayed.
The data submitted by GET is displayed in the address bar.
The data submitted by POST is not displayed in the address.


2. Whether sensitive information is secure.
The sensitive information submitted by GET is insecure.
POST submission sensitive information security.


3. Address Bar capacity
The data submitted by GET is stored in the address bar and cannot be submitted.
POST submission can submit large volumes of data.


4. Data encapsulation method.
GET submission encapsulates data in the request line of the request header.
POST submission encapsulates data in the Request body.




If the server is Tomcat.
The form is submitted in Chinese using get. After the server receives the form. Only the ISO8859-1 can be used to encode the received Chinese data at a time and decode the data with the specified Chinese character recognition code table.
When submitting a form with post, you can either use the preceding method or use the setCharactorEncoding (Chinese code table) method of an object request on the tomcat server to decode the Chinese data.
This method only decodes data in the Request body.


To sum up, the form is generally submitted using the post method.




What are the ways to interact with the server?
1. Enter the address bar. Get
2. hyperlink. Get
3. Form. Get post




Question 1: If enhanced validation is added to the form, you can submit only when all items are correct. Otherwise, it cannot be submitted.
Does the server still need to verify the registration data received?
Yes! Because of security.


Question 2: Does the form still need to be verified since the server side has been verified?
Yes. In order to enhance the user's online experience and reduce the pressure on the server.
What is the difference between get and post?

Get: All submitted information can be seen in the address bar, such as www.baidu.com/app? Id = 09 & pass = ui "target =" _ blank "> http://www.baidu.com/app? Id = 09 & pass = ui
Post: All submitted information is stored in the http Request body, which is invisible in the address bar. In addition, the amount of information that can be submitted by post is much larger than that of get. Form submission usually uses post

Q: What is the difference between get and post in the form?

1. Get is used to obtain data from the server, while Post is used to transmit data to the server.
2. Get adds the data in the form to the URL pointed to by action in the form of variable = value, and the two use "?" And each variable is connected by "&". Post puts the data in the form data body and passes the data to the URL indicated by the action according to the corresponding variables and values.
3. Get is insecure because data is stored in the request URL during transmission, nowadays, many existing servers, proxy servers, or user proxies record the request URL to a log file and place it in a certain place, so that some private information may be seen by a third party. In addition, you can directly view the submitted data in the browser. Some internal messages are displayed in front of the user. All Post operations are invisible to users.
4. Get transmission has a small amount of data, mainly because it is restricted by the URL length; while Post can transmit a large amount of data, so only Post can be used for uploading files (of course, there is another reason, as mentioned later ).
5. Get restricts that the dataset value of Form forms must be ASCII characters, while Post supports the entire iso000046 character set.
6. Get is the default Form method.

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.