Network request HTTP GET post one

Source: Internet
Author: User

Http defines different ways to interact with the server. The most important methods are 4 kinds. Each is get POST PUT DELETE, url full resource Descriptive descriptor, we can think of a URL address, a URL address, it is used to describe a network of resources. And the Get POST PUT DELETE in HTTP corresponds

1. Get is used for information acquisition in accordance with the HTTP specification. And should be safe and idempotent .

(1). The so-called security means that the operation is used to obtain information rather than change information.

In other words, GET requests generally should not have side effects.

That is, it just gets the resource information, like a database query, and doesn't change. Add data. Does not affect the state of the resource.

* Note: The meaning of security here is non-change information.

(2). Idempotent means that multiple requests to the same URL should return the same result.

Here I'll explain the concept of idempotent :

         idempotent The (idempotent, idempotence) is a mathematical or computer concept that is common in abstract algebra.


Idempotent has several definitions:
For monocular operations. Let's say that an operation is the same as the result of doing the operation for a number of times in the range and doing the operation once, then we call the Operation Idempotent. For example, the absolute value operation is a sample, in the real set, there is abs (a)=ABS (ABS (a)).
For binocular operations, it is required that when the two values of the participating operation are equivalent, the result of the operation is assumed to be equal to the two values of the participating operation. It is called the power of the operation, such as a function to find the maximum value of two numbers, in the real concentration idempotent. That is , Max (x,x) = x.


2 . According to the HTTP specification, post represents a request that could change resources on the server to



It probably says something about the original reason for Get and post in the HTTP specification.

But in practice, very many people do not follow the HTTP specification to do, resulting in a lot of solutions to this problem. Say:

  1. Very many people are greedy for convenience, when updating resources with get. Because it is necessary to use post to form (form), it will be a bit troublesome.

  2. Increase, delete, change of resources. In fact can be completed through the get/post. There is no need to use put and delete.

  3. The other one is. The early web MVC Framework designers did not consciously look at and design URLs as abstract resources . So one of the more serious problems is that the traditional Web MVC framework basically supports only get and post two HTTP methods. The put and delete methods are not supported.

* Simply explain that MVC:MVC is originally in the desktop program, and M refers to the data model. V refers to the user interface, and C is the controller. The purpose of using MVC is to separate the implementation code for M and v. So that the same program can use different forms of expression.




Network request HTTP GET post one

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.