Skip to content

Instantly share code, notes, and snippets.

@felixrabe
Created September 29, 2014 18:55
Show Gist options
  • Save felixrabe/c95b1d98fe4db496b697 to your computer and use it in GitHub Desktop.
Save felixrabe/c95b1d98fe4db496b697 to your computer and use it in GitHub Desktop.
Analysis of an example URI
https://www.example.com:9876/about/us.html?highlight=team#management
  • The scheme https is registered with IANA and refers to the protocol "HTTP over TLS", using TCP port number 443 by default, to determine the protocol used between client and server.

  • The authority www.example.com:9876 contains a host and a port:

    • The host name www.example.com is registered with DNS (which must be accessible separately) and refers to the IP address 93.184.216.119 to find the endpoint among all reachable hosts on the Internet.

      Also, it is included in the HTTP request as the "Host" field to distinguish among multiple virtual hosts that may be provided by the server software sharing the same IP address.

    • The port number 9876 overrides the default TCP port determined by the protocol. This requires that the endpoint at 93.184.216.119 has a process listening on that port.

  • The string /about/us.html?highlight=team is included in the HTTP request to the server.

    • The path /about/us.html is usually used to distinguish among multiple pieces of information provdided by the server on the same (virtual) host.

    • And the query ?highlight=team provides additional information as key-value pairs to the server that it may need to perform the desired action.

  • The fragment #management is not transferred to the server. It is used by the client as a secondary identifier relative to the resource obtained from the server using the other parts of the URI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment