2 comments

[ 6.7 ms ] story [ 12.7 ms ] thread
So... what’s the correct answer to the delete question posed? Should deleting an already deleted resource return 404? Or should it be idempotent and return the exact same response as the first success?
> URI not very RESTful > Your URI does not explain whats going on, simple like that.

In REST, URIs aren't expected to carry meaningful data, the context in which links are presented conveys the information about what the link is doing, the URI isn't required to do that and can be an opaque identifier (you might use a URI pattern that provides information in the URI for various other reasons, but it has nothing to with being RESTful, and relying on the URI as the main carrier of information is definitely not RESTful.)

> Hurting Idempotency > No matter how many times you call GET on the same resource, the response should always be the same and no change in application state should occur.

Idempotence is defined in terms of application state requested by the call, not results; DELETE is by definition idempotent, but the definition of idepomtence is such that whether you return a 200, 404, or 410 on a subsequent DELETE, idempotence is preserved.