On Tue, 2009-07-28 at 11:09 +0200, Masklinn wrote:
> No it doesn't, the only URL there is to discover in a REST service is  
> the endpoint (the service's root). Any other URL is extracted from the  
> content types (which are to be fully documented). There is nothing to  
> discover.

>From ...
http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven

    "A REST API should be entered with no prior knowledge beyond the
initial URI (bookmark) and set of standardized media types that are
appropriate for the intended audience (i.e., expected to be understood
by any client that might use the API). From that point on, all
application state transitions must be driven by client selection of
server-provided choices that are present in the received representations
or implied by the user’s manipulation of those representations. The
transitions may be determined (or limited by) the client’s knowledge of
media types and resource communication mechanisms, both of which may be
improved on-the-fly (e.g., code-on-demand). [Failure here implies that
out-of-band information is driving interaction instead of hypertext.]"

This is from the same guy that wrote this dissertation:
http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm

The point being: if you have to document your API for its usage to be
possible, the interaction with it is not restfull anymore.

So yeah, having beautiful URLs that correctly identify a resource is a
big plus.

Not to mention there's quite a difference between:
  /articles?user_id=30&state=new
and
  /user/30/articles/new

The second choice guides your selection. The user_id is mandatory and
you can also see that from the construction of this URL.

Another point of that quote is that transitions to other resources are
made by options presented or implied to you that are relative to your
current location. Those choices are easier to be presented/implied if
the URL itself is relative to your location.




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to