Tell the difference between get and post

Source: Internet
Author: User

This article describes the difference between get and post, for many students to understand the difference between the understanding is not very clear, then we today talk about the difference between get and post to the low there! Talk less and go straight to the chase!

1, the form of the request

    • GET request: The requested data is appended to the URL, to split the URL and transfer data, multiple parameters with & connection. The encoding format of the URL is encoded in ASCII rather than Uniclde, meaning that all non-ASCII characters are encoded before being transmitted.

    • POST request: The requested data is placed in the package body of the HTTP request packet.
      For example, the following name=shuaige is the actual transfer data.

[Plain] View plain copypost/inventory-check.cgi http/1.1  host:www.joes-hardware.com  content-type:text/ Plain  content-length:18  item=shuaige 2647

2, the size of the transmitted data

    • Get request: In the HTTP specification, there is no limit on the length of the URL and the size of the data being transmitted. However, in the actual development process, for get, the specific browser and server to the length of the URL is limited. Therefore, when a GET request is used, the transmitted data is limited by the URL length, and generally the amount of data transmitted does not exceed 2KB

    • POST request: Because it is not a URL value, theoretically it is not limited, but in fact, each server will specify the post submission data size restrictions, Apache, IIS have their own configuration.

3. Security

    1. GET request: The transport parameters are low security because the transmitted data is displayed in the URL, everyone is visible, and is cached and retained in the browser history.

    2. POST request: The data is stored in the request packet for transmission, is not displayed in the URL, and the parameters are not cached and saved in the browser history or Web server logs.

4. Types of transmitted data

    1. Get request: Only ASCII characters are allowed

    2. POST request: Supports multiple data types

5, the impact on the server

    1. GET request: Fetch data from the server, so-called check, just to get the server resources, not to modify.

    2. POST request: Submits data to the server, which involves updating the data, that is, changing the server's data.

Related recommendations:

PHP implements the Get and post request step instances using Curl

Get and post differences in PHP

Related Article

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.