Subject: Should a DELETE against a non-existent resource return a 2xx code?

From: Yaron Goland <[email-masked]>
Date: Mon, 20 Aug 2007 10:05:11 -0700

When I wrote the language around DELETE in Web3S I required that if a DELETE request is received for a URL that doesn't map to a resource then the response should be a 2xx since the intent of the DELETE request has been achieved - the URL doesn't map to a resource. I remember thinking that this is 'normal' HTTP behavior. But I can't find any backup for that thinking in RFC 2616. Also it does seem rather odd that executing a method against a URL that doesn't map to a resource would 'work' even if the goal of the method was to make sure the URL doesn't map to a resource. It feels like this should perhaps be a 404.

What's the opinion of the working group?

                Thanks,

                                Yaron

---

From: Julian Reschke <[email-masked]>
Date: Mon, 20 Aug 2007 19:20:27 +0200

Yaron Goland wrote:
> 
> 
> When I wrote the language around DELETE in Web3S I required that if a 
> DELETE request is received for a URL that doesn’t map to a resource then 
> the response should be a 2xx since the intent of the DELETE request has 
> been achieved – the URL doesn’t map to a resource. I remember thinking 
> that this is ‘normal’ HTTP behavior. But I can’t find any backup for 
> that thinking in RFC 2616. Also it does seem rather odd that executing a 
> method against a URL that doesn’t map to a resource would ‘work’ even if 
> the goal of the method was to make sure the URL doesn’t map to a 
> resource. It feels like this should perhaps be a 404.
> 
>  
> 
> What’s the opinion of the working group?

a) It really doesn't matter.

b) In doubt, use 404 (that's what's being used in WebDAV land).

Best regards, Julian

---

From: Henrik Nordstrom <[email-masked]>
Date: Thu, 23 Aug 2007 01:11:39 +0200

> What’s the opinion of the working group?

I would prefer 404. It's quite likely useful to the client to know that
the object wasn't found by the server.

404 is also in line with how servers respond to other requests for
non-existing resources.

Regards
Henrik

---

From: Yaron Goland <[email-masked]>
Date: Thu, 23 Aug 2007 09:40:06 -0700

Yeah it seems pretty clear now that 404 is the right answer. I think my internal spec lawyer just went looney.

> -----Original Message-----
> From: Henrik Nordstrom [mailto:[email-masked]]
> Sent: Wednesday, August 22, 2007 4:12 PM
> To: Yaron Goland
> Cc: [email-masked]
> Subject: Re: Should a DELETE against a non-existent resource return a
> 2xx code?
>

---

From: "Mike Dierken" <[email-masked]>
Date: Thu, 23 Aug 2007 21:31:19 -0700

Hmm, I've always preferred a 200 Success, on the basis that the state of
'being gone' is now successfully transferred. I've also thought it was good
to have multiple DELETE requests respond with the same status code. For
example, if the first DELETE failed to respond (but work was actually
performed), the second request (which could have been auto-retried by a
client library or intermediary) would return a 4xx code, even though the
resource existed at the time of the first request.

But there is a definite lack of clarity on the 'right' answer.

> From: [email-masked] 
> [mailto:[email-masked]] On Behalf Of Yaron Goland
> Sent: Thursday, August 23, 2007 9:40 AM
> To: Henrik Nordstrom
> Cc: [email-masked]
> Subject: RE: Should a DELETE against a non-existent resource 
> return a 2xx code?
> 
> Yeah it seems pretty clear now that 404 is the right answer. 
> I think my internal spec lawyer just went looney.
> 
> > I would prefer 404. It's quite likely useful to the client to know 
> > that the object wasn't found by the server.
> >

---

From: Yves Lafon <[email-masked]>
Date: Fri, 24 Aug 2007 02:57:17 -0400 (EDT)

> 'being gone' is now successfully transferred. I've also thought it was good

If the resource was not there in first place, a 404 indicates that.
If the resource is present, a 200 for the first DELETE, then 410 for the 
subsequent ones leave no room for ambiguity.

-- 
Baroula que barouleras, au tiéu toujou t'entourneras.

         ~~Yves