The difference between get and post in an HTTP request

Source: Internet
Author: User
Tags browser cache

1. Standard answer

    • Get is harmless when the browser is rolled back, and post submits the request again.
    • Get generated URL address can be bookmark, and post is not available.
    • The GET request will be active by the browser cache, and post will not, unless manually set.
    • A GET request can only be URL-encoded, while post supports multiple encoding methods.
    • The GET request parameters are kept intact in the browser history, and the parameters in the post are not retained.
    • A GET request has a length limit for the parameters that are passed in the URL, and the post does not.
    • For data types of parameters, get accepts only ASCII characters, while Post has no restrictions.
    • Get is less secure than post, because parameters are directly exposed to URLs, so they cannot be used to pass sensitive information.
    • The get parameter is passed through the URL and the post is placed in the request body.

2. In-depth answers

    • Get and Post are two methods of sending requests in the HTTP protocol.
    • HTTP is a protocol based on TCP/IP about how data communicates in the World Wide Web. (The underlying HTTP is TCP/IP.) So the bottom of GET and post is TCP/IP, which means that get/post are TCP links. Get and post can do the same thing. You have to add the request body to the GET, and the URL parameter to the post, technically it's all in line. )
    • Get generates a TCP packet, and post generates two TCP packets. (for the Get mode request, the browser will send the HTTP header and data, the server response 200 (return data), and for post, the browser first sends the header, the server responds to the continue, the browser sends data, Server response @ OK (return data))

The difference between get and post in an HTTP request

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.