• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Idempotency - Contradiction?

 
David Bates
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pg 116, Note in bottom corner: "Note: there are several different uses of the word 'idempotent'; we're using it in the HTTP/servlet way to mean thtat the same request can be made twice with no negative consequences on the server. We do *not* use 'idempotent' to mean that the same request always returns the same response, and we do NOT mean that a request has NO side effects" (emphasis is mine)

Pg 125, 4th Bullet Point: "GET requests are inherently (according to the HTTP spec) idempotent. They should be able to run multiple times without causing any side effects on the server." (emphasis is mine)

Have I missed something or do these statements contradict each other?
 
Kiaama Liames
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IDEMPOTENT: Can do the same thing over again , with no negative side effect.

POST is not idempotent and is the only one
 
David Bates
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the definition, but I'm asking if these two statements contradict each other or not. Do they?
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, they are not contradictory. There is a very subtle difference here.

Let me rephrase a bit:

Idempotent (in this context) means a request can be executed multiple times without any negative consequences.

The purpose of a GET is to retrieve data from the server. Executing a GET should not have any consequences (negative or otherwise) regardless of how many times it's executed. This satisfies the above requirement so a GET is idempotent.
 
David Bates
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, so something is idempotent if it can be run multiple times without any negative side-effects, but GET goes one step further than that by not causing *any* side-effects?
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic