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

5567Re: [rest-discuss] Correct REST principles

Expand Messages
  • Costello, Roger L.
    Dec 1, 2005
    • 0 Attachment
      > 1. Is it considered bad taste to use parameters (i.e. ?id=1) within the
      > URL? From
      what I have read it is but everyone seems to be doing it.

      This is an excellent question, and has also been a question on my mind of late.
       
      My thinking is this: The sole purpose of a URL is to "identify" a resource. 
       
      Tim Berners-Lee Axiom 0: every resource on the Web shall be uniquely identified by a URL.
       
      For example, this (logical URL) identifies a 747 aircraft resource:
       
       
      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).
       
      I am eager to hear what others are thinking on this topic.  /Roger
    • Show all 11 messages in this topic