• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PUT is not idempotent or not

 
PRavi kumar
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

The HTTP PUT is idempotent or not.

"PUT method is used to store some thing in server. if it's already exist it will repalce the content."

in above statement it changeing the content in server.

please clarify me.

Regards,
Ravi.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As per definition, a function f is idempotent if f(f(x)) = f(x).
That is, applying the function n times has the same effect as applying the function once.
When uploading a file to a server, it does not matter if I upload it once or five times - the contents on the server will be the same, thus PUT is idempotent.
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look here at the first point http://faq.javaranch.com/view?ScwcdHints
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic