Jerome Louvel <contact <at> noelios.com> writes: > > > Hi all, > > I'm a bit late in the discussion it seems :) > > Let me try to explain how the support for HEAD was designed in Restlet. > Following the definition of HEAD from the HTTP spec [1], I got convinced > that HEAD was only a special GET and nothing more: > > "The HEAD method is identical to GET except that the server MUST NOT return > a message-body in the response." > > In order to fulfill this requirement, the framework expects you (Resource > and any Restlet/Filter/etc.) to return the exact same response as you would > for the similar GET request. > > The trick is that at the HTTP server connector level, we never send back the > response's entity content for HEAD requests. Regarding my previous comments regarding a test using curl; it appears curl is hung up on the fact that content length has a value and there is no entity. I did determine that Restlet does remove the content. Sorry for being misleading on that point.
I'd say that Restlet meets the requirements of the spec and that's good. Although I still think it would be better to leverage Uniform entirely and it seems awkward to me that HEAD is an exception. My understanding of REST is that HEAD is part of the uniform interface and therefore should be supported in the same way, and to the same extent as the rest of the HTTP methods. I was very surprised when HEAD did not conform to the programming model in place for the uniform interface and I suspect others would be too. Sean

