The difference and connection between post and get in HTTP

Source: Internet
Author: User

HTTP defines different ways to interact with the server, with 4 basic methods, namely get,post,put,delete. URL full name is a resource descriptor, we can think: a URL address, which is used to describe a network of resources, and HTTP get,post,put,delete corresponding to this resource, change, increase, delete 4 operations.

Mainly talk about get and post. Get is typically used to get/query resource information, and post is typically used to update resource information.

First introduce the concepts of Get and post:

Get is used for information acquisition, and should be secure and idempotent.

Post represents a request that may modify resources on the server.

Difference and Contact:

1, GET request data will be appended to the URL (that is, the data placed in the HTTP protocol header), in order to split the URL and transfer data, the parameters are connected to &, such as: login.action?name=hyddd&password= IDONTKNOW&VERIFY=%E4%BD%A0%E5%A5%BD. If the data is an English letter/number, sent as is, if it is a space, converted to +, if it is Chinese/other characters, then directly to the string with BASE64 encryption, to obtain such as:%E4%BD%A0%E5%A5%BD, wherein the%XX in XX for the symbol in 16 binary notation ASCII;

2, get the amount of data transmitted less, this limit is the specific browser and server restrictions on it. IE's limit on URL length is 2083 bytes (2k+35). For other browsers, such as Netscape, Firefox, etc., there is theoretically no length limit, and its limitations depend on the support of the operating system. Post transmits a large amount of data, so in the upload file can only use post, is generally the default is unrestricted, the limit is the processing capacity of the server handler;

3, get security is very low (because the user can see through the URL), post security is high (all of its operations are not visible to the user). But the execution efficiency is better than the Post method;

4, get is the default method of form;

5. The data submitted by the Get method is obtained by using request.querystring () on the server side, and the data submitted by post is obtained by Request.Form (). ;

6, GET: query string is displayed in the Address bar URL, visible; POST: query string is not displayed in the Address bar, not visible;

7, GET request can be cached, GET request will be saved in the browser's browsing record, the URL of Get request can be saved as browser bookmark, POST request cannot be cached, POST request is not saved in browser browsing record, the URL of Post request cannot be saved as browser bookmark.


This article is from the "July boreas" blog, please be sure to keep this source http://luminous.blog.51cto.com/10797288/1833175

The difference and connection 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.