Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

which methods are Idempotent?

 
savita jadhav
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all
I want to know which methods r idempotent?
According to my understanding GET and HEAD are the only methods which are idempotent.All Other methods are not idempotent

Am I right?

Savita
 
Martyn Clark
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi savita
yes you are partly right, GET, HEAD, and PUT are idempotent, Post is considered to be idempotent because it is usally used to change things or update things on the server.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post is considered to be idempotent

I think that should read
Post is considered to be non-idempotent


This question has been asked many, many times. Search through this forum for "idempotent", and you will find all the discussions.
 
Martyn Clark
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf
bit of a typo there missed it :-(
 
Yi Yuan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is PUT idempotent ?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello "super goal"-

On your way in you may have missed that we have a policy on screen names here at JavaRanch. Basically, it must consist of a first name, a space, and a last name, and not be obviously fictitious. Since yours does not conform with it, please take a moment to change it, which you can do right here.
[ July 08, 2006: Message edited by: Ulf Dittmer ]
 
savita jadhav
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I think PUT is non idempotent.In the spec they have mentioned that it is not idempotent.
This method does not need to be either safe or idempotent. Operations that
doPut performs can have side effects for which the user can be held accountable.[
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

According to the HTTP specs only POST method is non-idempotent. All the methods are considered idempotent.

But in Servlet, It depends on how you implement the corresponding doXXX() methods.

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic