W3C home > Mailing lists > Public > ietf-http-wg@w3.org > April to June 2006

Re: PUT, side effects and 201 Created?

From: Julian Reschke <julian.reschke@gmx.de>
Date: Tue, 04 Apr 2006 09:14:30 +0200
Message-ID: <44321CD6.1050301@gmx.de>
To: Mark Baker <distobj@acm.org>
CC: Mark Nottingham <mnot@yahoo-inc.com>, ietf-http-wg@w3.org

Mark Baker wrote:
> 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.
> 
>> I.e., read literally, the above requirement requires a 201 Created
>> when PUT results in *any* resource being created -- even as a side
>> effect.
>>
>> This is IMO unnecessarily constraining, and should be relaxed; e.g.,
>> changed to something like
>>
>> "If a new resource is created at the Request-URI, the origin server
>> MUST inform the user agent via the 201 (Created) response."
> 
> Hmm, *that* seems more constraining to me; could the server not just
> return a Location header with value "/foo;2006-04-03" in the 201?

Well, I know of code that uses the status code for a PUT to find out 
whether the server has created a new resource (201) at *that* URL, or 
whether it was just updated (200). That may be considered a bad 
assumption, but I wouldn't be surprised if some generic client start to 
act weird if they think a certain URL was mapped, PUT to it, and then 
get a 201.

Best regards, Julian
Received on Tuesday, 4 April 2006 07:16:13 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 27 April 2012 06:49:44 GMT