Subject: Question on new PUT section

From: "Robert Brewer" <[email-masked]>
Date: Fri, 11 Mar 2011 10:59:16 -0800

http://trac.tools.ietf.org/wg/httpbis/trac/changeset/1158
modified section 7.6.p.5 to say:

 "For example, if the target resource is configured to always
 have a Content-Type of "text/html" and the representation being
 PUT has a Content-Type of "image/jpeg", then the origin server
 SHOULD do one of: (a) reconfigure the target resource to
 reflect the new media type; (b) transform the PUT representation
 to a format consistent with that of the resource before saving
 it as the new resource state; or, (c) reject the request with a
 409 response indicating that the target resource is limited to
 "text/html", perhaps including a link to a different resource
 that would be a suitable target for the new representation.

Roy, can you explain why 409 is a better choice than 415 in case (c)?

Robert Brewer
[email-masked]

---

From: "Roy T. Fielding" <[email-masked]>
Date: Fri, 11 Mar 2011 11:45:25 -0800

> Roy, can you explain why 409 is a better choice than 415 in case (c)?

It is just a slight preference for uniform handling of PUT
(409 is also used by webdav, IIRC).  415 was created for POST
handling processes.  It could go either way for this example.

Anyone know of implementations that do this kind of error?

....Roy

---

From: Julian Reschke <[email-masked]>
Date: Fri, 11 Mar 2011 20:54:20 +0100

> (409 is also used by webdav, IIRC).  415 was created for POST

...WebDAV does use 409 in several places, but it doesn't say anything 
specific about PUT. (as far as I recall)

> Anyone know of implementations that do this kind of error?

I believe Spring/Rest will return 415 if the media type isn't accepted.

Best regards, Julian

---

From: "Roy T. Fielding" <[email-masked]>
Date: Fri, 11 Mar 2011 12:20:25 -0800

On Mar 11, 2011, at 11:54 AM, Julian Reschke wrote:
> ...WebDAV does use 409 in several places, but it doesn't say anything specific about PUT. (as far as I recall)
> 

Ah, ugh, did I really need to look at that?

<http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-exceptionhandlers>

The exception is from the Jersey annotation support, so it might
apply to both POST and PUT.  I guess that means the example should
use 415 and the text above it should say to respond with 409 or 415,
as appropriate. 

....Roy