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. Here, you should have a general understanding, get is generally used to get/query resource information, and post is generally used to update resource information.
1. According to the HTTP specification, get is used for information acquisition and should be secure and idempotent.
(1). So-called security means that the operation is used to obtain information rather than modify information. In other words, GET requests generally should not have side effects. That is, it simply gets the resource information, just like a database query, without modification, adding data without affecting the state of the resource.
* Note: The meaning of security here is simply non-modification 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 (idempotent, idempotence) is a mathematical or computer concept that is common in abstract algebra. Idempotent There are several definitions: for monocular operations, if an operation is the same as the result of doing the operation for a number of times in the range and the result of doing it once, then we call the Operation Idempotent. For example, an absolute value operation is an example, in a real number set, there is abs (a)=ABS (ABS (a)). For binocular operations, it is required that when the two values of the participating operations are equal, if the results of the operation are equivalent to the two values of the participating operations, the exponentiation of the operation, such as a function of the maximum value of two numbers, is in the power of the real concentration, that is, Max (x,x) = x.
Talking about the difference between get and post in HTTP