URI - Uniform Resource Identifier

Fundamental importance of the URI/URL

  • URI = “Uniform Resource Identifier”
    1. Used to be called “Universal Resource Locator” (URL)
    2. Because the resources were files on the disk of the server
  • And the URL’s path was really a path!
  • Focus now on the ‘path’ part of the URI

# don't do this

http://roomscheduler.com/monday
http://bookstore/gonewiththewind/order/3
http://nyt.com/3332/2312/a

# do this

http://roomscheduler.com/calendar?day=monday
http://bookstore/books/4931231/order?units=2
http://nyt.com/issue/3332/article/2312/a

RESTful style of URI design

  • “Representational State Transfer” (See Original REST Paper)
  • Each URI denotes a specific ‘resource’
    1. Displat calendar for Monday; create an order for book 4931231 or show NYT issue 332’s article 2312, section a
    2. It is usually not a file but something generated ‘on the fly’
    3. Still the same URI should yield the same resource every time (hand-wave)
  • Each URI is used in combination with an HTTP “method”
    1. GET: retrieve the indicated “resource”
    2. PUT: update value of the indicated resource
    3. DELETE: delete the indicated resource
    4. POST: Create a new instance of indicated resource
    5. (some other, less important ones)

One of the earliest design questions

  • What do the URLs for my app look like?s
  • Conceptually, they are “directory structure-like” URLs
  • There is a coherent “syntax” about them, e.g.
    1. http://www.myservice.org/discussion/topics/{topic}
    2. http://www.myservice.org/discussion/2008/12/10/{topic}
    3. http://www.myservice.org/discussion/{year}/{day}/{month}/{topic}