The difference between post and get in HTTP

Source: Internet
Author: User
Tags browser cache

1. The difference on the surface

1.GET is harmless when the browser is rolled back, and post submits the request again

The URL address generated by 2.Get will be bookmark, and post will not

3.Get requests will be active by the browser cache, and post will not, unless actively set

4.Get requests can only be URL-encoded, while post supports multiple encoding methods

5.Get request parameters will be fully saved in the browser record, and the post parameters will not be retained

6.Get requests the parameters passed at the URL are limited by length, and post does not

7. For data types of parameters, get accepts ASCII characters, while Post has no restrictions

8.Get is less secure than post because parameters are directly exposed to URLs, so they cannot be used to pass sensitive data

The 9.Get parameter is passed through the URL, and the post is placed in the requestbody.

And the post and get are essentially no different.

1.Post and get are two ways to request HTTP protocol

The 2.HTTP protocol is a TCP/IP-based protocol on how data communicates in the World Wide Web

Both 3.Get and post are TCP/IP,

4.Http is a code of conduct that defines a number of different service categories, get,post,put,delete, etc.,

5.Get and Post parameters limit, different browsers and servers will limit the amount of a single transmission based on cost. The amount of data is too large for both the browser and the server, and most browsers limit the URL length to 2K, while most servers handle up to 64K of the URL. If the Get service is used to hide data in Requestbody, different servers will handle different ways, and some servers can parse the data read, some directly ignore it. That is, even if the body can add data to the request, there is no guarantee that it will be received.

There is no difference between post and get nature, but because of the HTTP rules and browser/server limitations, the application process is different.

Big Boss ...

The maximum difference between get and post is that get generates a TCP packet, and post generates two TCP packets.

1.Get request, the browser will send HTTP header and date together, server response 200 (return data)

2.Post mode request, the browser sends the header first, the server responds to the continue, the browser sends the data, the server responds with a max OK (return data)

Because the post takes two steps, it consumes a little more time.

In a good network environment, a packet and two times, the time difference can be ignored,

In the case of poor network environment, two requests of TCP, in the packet verification integrity, more advantages.

Not all browsers are sent two times with Post, and Firefox is sent once.

The difference between post and get in HTTP

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.