幂等性方法定义:
9.1.2 Idempotent Methods
Methods can also have the property of “idempotence” in that (aside from error or expiration issues) the side-effects of N > 0 identical requests is the same as for a single request. The methods GET, HEAD, PUT and DELETE share this property. Also, the methods OPTIONS and TRACE SHOULD NOT have side effects, and so are inherently idempotent.
(幂等性有下面的属性:当操作次数N>0时,每次得到的结果是相同的,在http请求中GET, HEAD, PUT and DELETE 方法具有幂等性)
However, it is possible that a sequence of several requests is non- idempotent, even if all of the methods executed in that sequence are idempotent. (A sequence is idempotent if a single execution of the entire sequence always yields a result that is not changed by a reexecution of all, or part, of that sequence.) For example, a sequence is non-idempotent if its result depends on a value that is later modified in the same sequence.
(非幂等操作同样有重要的意义,比如说最终结果需要依赖一系列修改的时候)
A sequence that never has side effects is idempotent, by definition (provided that no concurrent operations are being executed on the same set of resources).
(如果一个操作不是负面影响的,就是幂等操作)比如:在http请求中get 操作,sql中的select操作都是幂等的,而http的put操作,sql的update操作都是非幂等的。
参考:
https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
http://www.cnblogs.com/weidagang2046/archive/2011/06/04/2063696.html