Loading ...
Sorry, an error occurred while loading the content.

5570Re: [rest-discuss] Correct REST principles

Expand Messages
  • Donald_Strong@national.com.au
    Dec 1, 2005
      Hi Roger and Christian,

      > If we agree that the sole purpose of a URL is to identify a resource,
      > then I cannot see why a person would ever use query strings.
      > If information needs to be passed to the resource, then you must
      > ask "why?" Are you wishing to update a resource? If so, then you
      > should POST the information to the resource (and the resource is
      > identified using a logical URL without any query strings).

      A query URL (ie. a URL that contains a query path) is useful in a
      web service for the same reason it is useful in HTML; It allows the
      User Agent to construct a URL according to a specification provided by
      the Origin Server. The User Agent can then GET the representation
      with a high expectation that the URL will be understood and accepted.

      I have likened this, in the past, to asking a question of the resource.
      This makes sense if the resource that provided the form (input
      specification)
      is the same one the form is submitted to, eg.

      GET http://acme.com/aircraft

      <form action="/aircraft">
      <input type="text" name="manufacturer"/>
      <input type="text" name="pax_capacity"/>
      </form>

      GET http://acme.com/aircraft?manufacturer=Boeing&pax_capacity=300


      > But I propose the following: http://[host
      ]///[universe]/[galaxy]/[system]/[planet]/90.0%2012.0

      I have also suggested using segment parameters in the past.

      http://acme.com/universe/milkyway/sol/earth/lat=90.0;long=12.0/30000

      This has the advantage that more segments can be used after the params.
      In this case I have specified a height or 30000 feet.

      Donald.
    • Show all 11 messages in this topic