Re: Question regarding POST versus PUT for creating an LDPC

hello arnaud.

On 2013-04-18 14:01 , "Arnaud Le Hors" <lehors@us.ibm.com> wrote:
>So, you're saying that somehow the server needs to advertise what URLs
>the client can use to create resources using PUT, right?

yes. supporting unconstrained PUT (PUT into the universe of all possible
URIs) doesn't make a whole lot of sense. supporting PUT into some
constrained URI space may make sense, but that space needs to be defined
somehow, at least in a way that a client has a reasonable chance to come
up with a URI that will actually work.

>We've already agreed to adding support for slugs on POST to a container.
>How can we use them to let the server tell the client what URLs it can
>PUT to? Wouldn't that be another use case for URL templates?

there are different ways in which you could do it. i think the first
question is what you want to do, and then the next question is how to map
this to RESTful interactions using HTTP as much as possible.

if you want to allow pretty unconstrained PUTs, you could publish a prefix
and tell clients to go ahead and PUT to any URI with that prefix. that
would of course create the kind of weird names that POST/Slug are trying
to avoid by delegating the actual URI choice to the server.

if you want to allow PUT to somehow achieve POE semantics, maybe
http://dret.typepad.com/dretblog/2011/11/creating-resources-with-get-put.ht
ml is what you want, but that is some pretty elaborate interaction dance.

from the current spec i cannot really tell what PUT is supposed to do
(where you're supposed to PUT, and what that means), but once that is
clarified, we can look at possible interactions that achieve that goal.

cheers,

dret.

Received on Thursday, 18 April 2013 21:25:54 UTC