Idempotence (idempotent and idempotence) is a mathematical or computer concept that is common in abstract algebra.
Idempotence has the following definitions:
1. for a single-object operation, if an operation is performed multiple times for all the numbers in the range, the result is the same as that obtained once, this operation is called idempotent. For example, an absolute value operation is an example. In a real number set, ABS (A) = ABS (a) is used )).
2. for binary operations, it is required that when the two values involved in the calculation are equivalent, if the calculation result is equal to the two values involved in the calculation, the operation is called the idempotence, for example, a function that calculates the maximum values of two numbers has the power in the real number set, that is, Max (x, x) = x.
Idempotence can be understood as the situation where multiple operations will produce equivalent results. Or operations at different times will not affect the results.
Idempotence and get and post
What is the difference between get and post, and when to use them.
Theoretically, if the request is idempotent, get can be used. The so-called idempotence means that multiple requests return the same result. In fact, the corresponding server method may modify the status in some way, so this is generally not true. This is just a standard. MoreThe actual difference is the size of the Net Load. In many cases, the browser and server limit the URL length to send data to the server.
Generally, get can be used to obtain data from the server. In other words,Do not use get to change the status on the server.
Generally, the POST method should be used when the status on the server is changed. Unlike get, you need to set the Content-Type header of the XML-httprequest object, as shown below:
XMLHTTP. setRequestHeader ("Content-Type", "application/X-WWW-form-urlencoded"); different from get,Post does not limit the size of the Net Load sent to the server, and the POST request cannot be idempotent.
Most of the requests you make may be GET requests. However, you can use post if necessary.
Payload)
A frame (Package) contains only the control information of the frame header and the end of the frame.
The net (negative) load is relative to the overhead. That is, we can recognize the amount of valid load data.