On Oct 5, 2006, at 10:35 AM, Ian Bicking wrote:

>> POST /messages/1;test   -> messages.test()
>>
>> Or maybe you want to add a preview option to a new member  
>> resource, you
>> could. Does that help?
>
> Would it be POST /messages/1;preview+edit ? (or preview_edit)  Simply
> ;preview would also be useful without the edit form.

Woops, my bad there. I meant:
POST /messages;test -> messages.test()

A new member addition doesn't know what ID it has, so it can't post  
to a specific resource ID. So for preview it'd be:
POST /messages;preview -> messages.preview()


> Also, preview involves changing the form action, which isn't hard but
> does require Javascript.
>
> I personally really dislike POST /messages/ meaning create.  It feels
> very vague to me.  But anyway, there'd also be a POST
> /messages/;preview.  This is what bothers me about it, as there's all
> these actions that happen on /messages/ related to new items, as  
> well as
> /messages/ has its own set of methods to deal with the collection.   
> The
> collection and new items aren't the same thing.

Right, though only two methods deal with the entire collection, the  
POST /messages to add a new message to the collection, and GET / 
messages to retrieve a representation of the collection. Most of the  
methods deal with editing, updating, and removing existing members of  
the collection.

> Also, I don't like "POST /messages", as it also feels vague; better  
> when
> an object is always a directory or never a directory.  But eh.  At  
> least
> it should be consistent.  But consistent with what?  And can every  
> piece
> of content become a collection in its own right?  Then you can  
> never be
> sure whether an extra / is called for.

As its being RESTful, its not referring to a directory, but the URI  
is a representation of a resource, so 'messages' is the resource, not  
a directory. I think a lot of content will work as its own resource,  
but there's obviously exceptions. The biggest bonus about having a  
resource setup like this is that it makes it really easy to setup an  
API so that you can have RESTful web services in addition to the HTML  
pages you cruise through.

- Ben

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss
-~----------~----~----~----~------~----~------~--~---

Reply via email to