Get and Post comparisons

Source: Internet
Author: User

Data size is limited in 1,get

We all know that many old-fashioned browsers have limited the number of strings in URLs to 255, although the current version of the browser does not have this egg-ache limit, but we do not guarantee that all users who visit the site are using the new version of the browser. So when we need users to fill in some information on the page, using get will definitely be a problem. Instead of this limitation in the Post method, we can transfer data of any size.

The data type in the 2,get is not flexible

Because get is used to transfer data using URLs, it is inconvenient to transfer characters such as space characters and similar &. We can use the pre-send code, and accept the decoding method to solve.

3, security

In get, the parameter is attached to the URL suffix in the query string of the name value pair, so this is easily queried by the browser history. All the data is also submitted in text, so we know that the password for the login operation is absolutely not allowed to be submitted using the Get method. On the contrary, the post method is much safer. All name-value pairs are transmitted in the same way as the message body in HTTP request.

4, speed

Obviously get faster than post.

5, bookmarks

In fact, there are a few cases with get better, such as you can bookmark the name value of the way to store and directly in the sub-form of the use. But it can't be done under post.

6. Form Upload

Uploading a file as a form can only be done using Post, and get is almost impossible.

7, data loss

The server may lose data when it encodes data that is submitted by the Get method. But it's not for post.

8, transmission mode

Get uses the Stack method to transfer form variables, and post uses the Heap method to transfer form variables.

9, limit the number of parameters

Get up to 18 parameters at a time and post does not have this limit.

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