What exactly is Idempotent, which method is idempodent and which is not and how and why?
Thanks.
Nila dhan
Ranch Hand
Joined: Sep 15, 2005
Posts: 160
posted
0
idempotent is something(for eg a resource) which is not changed or modified in any case.The Get method is idempotent whereas the post method is not.Am i right?cud anybody verify
Idempotent methods are one which returns the same result. For example multiply(a,b). The method does not have any side effect. The HTTP GET methods method is supposed to be idempotent whereas POST is not.
An Idempotent operation is an operation that if run multiple times has no affect on state -- that is, it is query only not update.
Adeel Ansari
Ranch Hand
Joined: Aug 15, 2004
Posts: 2874
posted
0
Originally posted by nila dhan: The Get method is idempotent whereas the post method is not.Am i right?cud anybody verify
Quite right. Learning, it is good.
Arjunkumar Shastry
Ranch Hand
Joined: Feb 28, 2005
Posts: 986
posted
0
Yes. Mathematically,if R is some set and if it holds Associative/distibutive/closure properties and if some element x of R has the property such that x*x = x then element x is said to be idempotent. For example ,any square identity matrix should be idempotent. [ September 30, 2005: Message edited by: Arjunkumar Shastry ]
The original design of the GET method was to be idempotent (in the dark, early days of the internet) but this is the intent and should not be taken as fact.
Originally posted by David O'Meara: The original design of the GET method was to be idempotent (in the dark, early days of the internet) but this is the intent and should not be taken as fact.
I have seen lot of web applications where GET is used to update data at the server side.
ankur rathi
Ranch Hand
Joined: Oct 11, 2004
Posts: 3829
posted
0
Thanks a lot everybody.
ankur rathi
Ranch Hand
Joined: Oct 11, 2004
Posts: 3829
posted
0
On page 114 of HFSJ, at the bottom, this is written: "Post is considered idempotent by the HTTP 1.1 specs".
And just before 2 or 3 pages to this, they are writing that, when ever it is post think of update.
So post can't be idempotent (it may be but we should not consider it idempotent).
Thanks.
Satish Chilukuri
Ranch Hand
Joined: Jun 23, 2005
Posts: 266
posted
0
On page 114 of HFSJ, at the bottom, this is written: "Post is considered idempotent by the HTTP 1.1 specs".
And just before 2 or 3 pages to this, they are writing that, when ever it is post think of update.
So post can't be idempotent (it may be but we should not consider it idempotent).