Solved

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

Posted on 2015-01-24
6
99 Views
Last Modified: 2015-01-29
Why are 'PUT' and 'DELETE' considered idempotent?
0
Comment
Question by:KPax
  • 3
  • 3
6 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
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
 

Author Comment

by:KPax
Comment Utility
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
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 500 total points
Comment Utility
In theory, only POST method is supposed to be used to change something like a database record.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Assisted Solution

by:KPax
KPax earned 0 total points
Comment Utility
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
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
Comment Utility
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
 

Author Closing Comment

by:KPax
Comment Utility
Additional thought and clarification from me regarding question.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now