Re: If-match clarification

Hi Henrik,

--On June 20, 2007 10:44:28 PM +0200 Henrik Nordstrom 
<henrik@henriknordstrom.net> wrote:

>> But what about the case of an etag provided in If-Match against a
>> resource  that no longer exists? Should the server return 404 or 412?
>
> 404 I would say, at least if it's a GET/HEAD.
>
> Errors is not normally subject to If-* conditions. If-* conditions only
> applies when the server actually could generate a successful response if
> the condition was not there.
>
> For PUT 412 is probably more appropriate there as it's the condition
> which prevented the method from being executed, not the fact that the
> resource no longer exists.

Actually I think being able to distinguish between "resource changed" vs 
"resource deleted" on PUT is useful. Consider that a client is likely using 
If-match in order to synchronize its changes with the server. So in the 
case of a "resource changed" the client would give the user three choices 
to fix: overwrite server copy with local copy, overwrite local copy with 
server copy, merge server and local copies. In the case of "resource 
deleted" there would only be two choices: save local copy to server, delete 
local copy. Being able to pick the appropriate course of action based on 
the response code (without the need to do another request to see if the 
resource exists) would be useful.

-- 
Cyrus Daboo

Received on Wednesday, 20 June 2007 21:39:37 UTC