Solved

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

Posted on 2015-01-24
6
113 Views
Last Modified: 2015-01-29
Why are 'PUT' and 'DELETE' considered idempotent?
0
Comment
Question by:KPax
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 83

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 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 500 total points
ID: 40568324
In theory, only POST method is supposed to be used to change something like a database record.
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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 83

Accepted Solution

by:
Dave Baldwin earned 500 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
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)

624 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