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
  • e.g. some ugly examples
    1. http://roomscheduler.com/reserve/room/3
    2. http://bookstore/gonewiththewind/order/3
    3. http://nyt.com/latest-updates?year=2014
  • e.g. some good examples
    1. http://roomscheduler.com/room/3/request
    2. http://bookstore.com/book/412/price
    3. http://tourmanager.com/city/boston/tour/tuesday/new
  • There are many ways to structure a url

RESTful style of URI design

  • “Representational State Transfer” (See Original REST Paper)
  • Each URI denotes a specific ‘resource’
    1. ‘room 3’ or ‘book 412’ or ‘Tuesday tours IN Boston city’
    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?
  • 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}