Why are 'PUT' and 'DELETE' considered idempotent?

Why are 'PUT' and 'DELETE' considered idempotent?
KPaxAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
Yes, I agree... except I never use that word, 'idempotent'.  It doesn't describe any of the things you mention.  I don't have any hosting that uses PUT and DELETE.  At least not that I know of.
0
 
Dave BaldwinFixer of ProblemsCommented:
To quote this page http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Idempotent_methods_and_web_applications
PUT and DELETE are defined to be idempotent, meaning that multiple identical requests should have the same effect as a single request
0
 
KPaxAuthor Commented:
I know how to use wikipedia, thank you.
How comes that would be the true?
If you have resource on server and DELETE it you will get 200 or 202, then the next DELETE wouldn't have same effect as you already deleted resource and you will get 404. And what if I PUT some resource on server that irreversibly changes/affect state of some other component (DB record maybie)?
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
In theory, only POST method is supposed to be used to change something like a database record.
0
 
KPaxConnect With a Mentor Author Commented:
So, would you agree that in practice PUT and DELETE might not be idempotent all of the time? Depending on circumstances of  course - programmers error, intention, inexperience etc?
0
 
KPaxAuthor Commented:
Additional thought and clarification from me regarding question.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.