[LRUG] REST and Associations

Tim Fletcher twoggle at gmail.com
Sat Mar 3 10:59:50 PST 2007

On 27/02/07, Eleanor <eleanor at goth-chic.org> wrote:
> However in (X)HTML land your application has to provide an interface
> that allows a resource to be presented in an editable manner, hence
> the use of a parameter to a GET request to return a representation
> that can be edited by the browser. In this case you are not using
> 'edit' as a verb, but as a noun identifying the edit form itself.

I've never understood why there seems to be an aversion to using
/posts/1 as the 'edit' form. If the current user isn't allowed to edit
the resource then just a plain 'view' action can be rendered instead.
That would then be much closer to the raw HTTP usage.

Background reading ([1] and [2]) would suggest that the semicolon (or
the part after it) is meant to denote "parameters". So the Rails usage
is valid, but for 'edit' forms unecessary (IMO).

[1] http://en.wikipedia.org/wiki/URI_scheme#Generic_syntax
[2] http://tools.ietf.org/html/rfc2396#section-3.3

> A common mistake with pagination schemes is to mandate the number of
> page entries on the server side, which is not where responsibility
> should lie (HTTP servers should not maintain state, even if it is one-
> size-fits-all 'default' state).

Completely agree. What URI would you use to represent the size of the
resource collection though? Something that the client could query to
decide how it wanted to paginate (if at all). Not sure about this
one... something like /posts;size?

Leonard and Sam's book
(http://www.crummy.com/writing/RESTful-Web-Services/) looks like it
might be useful here!

More information about the Chat mailing list