File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes Is Delete action idempotent? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Is Delete action idempotent?" Watch "Is Delete action idempotent?" New topic
Author

Is Delete action idempotent?

Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 758
In MZ's notes, it says in RESTful service, "Delete" is defined to be idempotent meaning "multiple identical requests should have the same effect as a single request".
But I think deleting a resource for the first time return status = ok, but deleting the same resource for the second time, it will return status = Not found.
I believe delete is non-idempotent.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41815
    
  62
It may be counter-intuitive, but DELETE is idempotent. The result of successive request to remove an object are the same - the object is deleted. The status returned to the client may be different, but the effect as far as the resource is concerned is the same.


Ping & DNS - my free Android networking tools app
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61196
    
  66

Most people think of idempotent as "doesn't change server state". And that's wrong.

It's more correct to think of it, as Ulf pointed out, as "has same effect each time" as pointed out in the quote.

The term "same effect" is meaningful here: the status code is not an effect.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is Delete action idempotent?