From Microformats Wiki
Revision as of 01:03, 9 November 2005 by DrErnie (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

URL Conventions

You can get a bit more mileage from having separate lists and instances of your widgets.

There is nothing that says you must organise resources hierarchically, although many people prefer to do so. There are advantages to separating your containment hierarchies from your components. It makes it trivial to add new containers and the containers can accept search parameters.

Example URLs

You could organise your URIs like this:

  • The second widget
  • A form describing how to create a widget
  • The list of the first N (say N=25) widgets
  • The list of the next N widgets starting at 26

Example Actions

Then consider a sequence of hypertext style actions:

  • Retrieve a list of widgets
  • Retrieve details of the second one
  • Replace some of the details
  • Retrieve a form (resource parameter decription)
  • or whatever you want to call it, for creating widgets
  • Create a new widget
<= LOCATION:  //
  • Get the new widget
  • Delete the Widget


This organisation is similar to that of the rest-discuss html interface. But you cannot use PUT, POST and DELETE in that interface.

Using the URI for creating new widgets is similar to the Prototype design pattern while still adhering to the expected behaviour of a POST, ie. create a subordinate resource.