Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

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

Expert Comment

by:Dave Baldwin
ID: 40568028
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
ID: 40568032
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 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 1500 total points
ID: 40568324
In theory, only POST method is supposed to be used to change something like a database record.
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 

Assisted Solution

by:KPax
KPax earned 0 total points
ID: 40568404
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 84

Accepted Solution

by:
Dave Baldwin earned 1500 total points
ID: 40568499
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
ID: 40577052
Additional thought and clarification from me regarding question.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 discusses how to create an extensible mechanism for linked drop downs.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

972 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