[erlang-questions] Rest wrong, Append instead of PUT?

Hynek Vychodil vychodil.hynek@REDACTED
Tue Mar 18 10:21:51 CET 2008


I'm working on some REST project and I agree with you. We use POST for
CREATE (aka append to some collection) and append operations, but PUT only
for UPDATE (aka replace existing resource). We are not using use case PUT on
non exists URI aka CREATE so we have it as allowed design if need.

On Tue, Mar 18, 2008 at 8:52 AM, bryan rasmussen <rasmussen.bryan@REDACTED>
wrote:

> Well the problem is probably more PUT, PUT has three possible uses,
> CREATE, APPEND, UPDATE:
>
> 1. PUT a resource for the first time on the server. Thus matching
> CREATE in a CRUD operation.
> 2. PUT using Content-Range: to append to the end of a resource.
> 3. PUT new version of resource on the  server. Thus matching UPDATE in
> a CRUD operation.
>
> However these usages are not specified as such - IIRC they are
> implicit not explicit - thus a particular REST system could specify
> further:
>
> 1. PUT a resource for the first time on the server, disallow other uses of
> PUT
> 2. POST an update on any resource, disallow uses of PUT to append or
> UPDATE.
>
> personally I don't think there is a problem (theoretically) with
> specifying PUT with Content-Range to append, and specifying that if a
> resource exists you can only put to it with a Content-Range, and the
> method to calculate what ranges are allowed. However it is sort of low
> level to have to be doing that kind of thing.
>
> Cheers,
> Bryan Rasmussen
>
>
> On Tue, Mar 18, 2008 at 6:27 AM, Matthew Dempsky <matthew@REDACTED>
> wrote:
> > On 3/17/08, Joe Armstrong <erlang@REDACTED> wrote:
> >  >  Email is pretty much like Erlang. Pid ! X appends X to Pid's message
> queue,
> >  >  just like mailing to somebody@REDACTED
> >
> >  POST seems perfectly suited for this.  Pid becomes a URI, and X
> >  becomes the request entity.
> >
> >
> > _______________________________________________
> >  erlang-questions mailing list
> >  erlang-questions@REDACTED
> >  http://www.erlang.org/mailman/listinfo/erlang-questions
> >
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



-- 
--Hynek (Pichi) Vychodil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080318/aec3f90b/attachment.htm>


More information about the erlang-questions mailing list