Nuts and Bolts: URL's

INFO 153B/253B: Backend Web Architecture

Kay Ashaolu

URI

URI - URL - URN

  • URI (Identifier)
    • Identifies some resource (e.g. person or file)
  • URL (Location)
    • Specifies the Location of an identifier
    • Implies availability
  • URN (Name)
    • Specifies the Name of an identifier
    • Does not imply availability

Example

  • Full URI
    • http://www.yelp.com/biz/jupiter-berkeley#query:jupiters
  • URL Portion
    • http://www.yelp.com/biz/jupiter-berkeley
  • URN Portion
    • www.yelp.com/biz/jupiter-berkeley#query:jupiters

Resource

  • Any concept you can name or identify
  • So far, typically files
  • Also generated pages, like a user profile

Components

  • http://www.yelp.com/biz/jupiter-berkeley#query:jupiters

Scheme

  • http://www.yelp.com/biz/jupiter-berkeley#query:jupiters
  • Specifies how the rest of the URI is laid out
  • Typically protocols

Hirearchical

  • http://www.yelp.com/biz/jupiter-berkeley#query:jupiters
  • "Directions" to the resource through hosts and folders

Domain / Hostname

  • http://www.yelp.com/biz/jupiter-berkeley#query:jupiters
  • "Site" or machine name

Path

  • http://www.yelp.com/biz/jupiter-berkeley#query:jupiters
  • Similar to directories, but not necessarily linked!
  • Groups common resources together

Path

  • Relative
    • biz/jupiter-berkeley#query:jupiters
  • Absolute
    • http://www.yelp.com/biz/jupiter-berkeley#query:jupiters

Query (Optional)

  • https://www.google.com?q=ischool&ref=class
  • Starts with ?
  • key=value pairs, delimited by &
  • URLEncoded

Port Number

  • https://www.ischool.berkeley.edu:443/index.php
  • Specifies a port number to connect to
  • Ports are like doorways to a server
  • Common ports: 80 for HTTP, 443 for HTTPS

Fragment

  • http://en.wikipedia.org/wiki/URI_scheme#Examples
  • Specify a sub-resource, eg. a section on a page
  • Browser will jump to element id

Questions?