Re: [ISSUE-32] Implications of updates on protocol, regarding HTTP methods

On 29 Jul 2009, at 21:12, Jacek Kopecky wrote:

> On Wed, 2009-07-29 at 20:31 +0100, Steve Harris wrote:
>> There is a subtlety here that's not been accounted for, PUT/DELETE  
>> and
>> POST/GET are not operations at the same level. PUT and DELETE have
>> fairly specific semantics whereas GET (with CGI arguments) and POST
>> are transports for operations with their own semantics.
>
> Steve, I'm not sure I understand how you mean GET to be a transport  
> for
> operations with their own semantics? The operation is "retrieve the
> content of" and the object is identified by the URI. Yes, the URI may
> identify a view on another resource (e.g. a query), but the operation
> remains.

Well, I said explicitly "GET (with CGI arguments)", eg.

http://google.com/?query=... could be a SPARQL query, but
http://google.com/?q=... is a google text query and so on.

Whereas PUT doesn't typically have the CGI arguments, so there's no  
additional semantics.

> POST, depending on who you ask, is either completely open (do what you
> wish, even GET/PUT/DELETE if you don't mind the intermediaries won't
> know what you're doing), or an addition of data to a resource. Only  
> some
> uses of POST can truly be seen as transports for operations with their
> own semantics - when a single URI does different things upon receiving
> different bodies.

Ah, yes, I wasn't aware that there was a from of POST with just a  
payload. Reading RFC 2616 makes it clearer that the transport is not  
intended to be defined as purely with arguments.

>> Specifically, it is not normal to attach arguments to PUT or DELETE
>> requests - the URI given after the verb, plus the headers are  
>> supposed
>> to contain all the information. Eg. a DELETE to http://example.com/ 
>> foo
>> has a fairly specific meaning, whereas a POST to http://example.com/
>> foo has no specific meaning on it's own.
>
> PUT is supposed to have a body, which will replace the contents of the
> resource identified by the request URI. DELETE does not have a body.

Exactly.

- Steve

Received on Wednesday, 29 July 2009 22:43:29 UTC