Re: PUT, side effects and 201 Created?

Am 04.04.2006 um 03:01 schrieb Mark Baker:

>
> On 4/3/06, Mark Nottingham <mnot@yahoo-inc.com> wrote:
>>> If a new resource is created, the origin server MUST inform the
>>> user agent via the 201 (Created) response.
>> So, if I PUT something to /foo, and it has the side effect if
>> creating /foo;2006-04-03, is the response required to be a 201  
>> Created?
>
> Seems so.

Hmm, "side effect" is too general. Look at the two side effects:

Example A: WebDAV DeltaV uses 201 and Location header to indicate the  
upon checking a new version was created and where it lives.

Example B: A general server failure, normally answered with 500, is  
logging the failure reason in a new resource which can be retrieved  
via GET. It makes no sense to answer a 201 instead of 500 in such a  
case.

Clearly we would like to say that A is following the intention of the  
spec, while returning 201 in case B is not required.

Regards, Stefan

Received on Tuesday, 4 April 2006 08:42:22 UTC