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

Is Put Idempotent or Not?

 
Chandrakanth
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is Put Idempotent or Not
In the Kathy's book, they have mentioned that get,head and put are idempotent

I got this from API for doPut: This method does not need to be either safe or idempotent
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Only POST method is considered as non-idempotent. Practically you can implement any method as non-idempotent in your servlet.

Thanks
 
mo sayed
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I understand it, the HTTP Spec regards GET as idempotent although it is possible to write a doGet(..) method which is not. However a GET should not really change anything on the server; as it's name suggests, it should only really retrieve information. Conversely POST is not idempotent since the data it contains may be used for an irreversible transaction. Hence it's not considered Idempotent.

Hope that helps.

regards

Mo SCJP 1.4, SCWCD (in Progress)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic