URI - Uniform Resource Identifier
Fundamental importance of the URI/URL
- URI = “Uniform Resource Identifier”
- Used to be called “Universal Resource Locator” (URL)
- 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’
- Displat calendar for Monday; create an order for book 4931231 or show NYT issue 332’s article 2312, section a
- It is usually not a file but something generated ‘on the fly’
- Still the same URI should yield the same resource every time (hand-wave)
- Each URI is used in combination with an HTTP “method”
- GET: retrieve the indicated “resource”
- PUT: update value of the indicated resource
- DELETE: delete the indicated resource
- POST: Create a new instance of indicated resource
- (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.
http://www.myservice.org/discussion/topics/{topic}
http://www.myservice.org/discussion/2008/12/10/{topic}
http://www.myservice.org/discussion/{year}/{day}/{month}/{topic}