The web

HTTP

HTTP = HyperText Transfer Protocol

HTML = HyperText Markup Language

HTTP specifies how documents/resources are transferred (downloaded/uploaded) over the web. They can be any sort of file.

URL = Uniform Resource Locator – the address of some file (page) on the web.

Example: https://liucs.net/cs101f17/
          ^1      ^2       ^3
  1. is the protocol portion of the URL (usually just http or https but there are others)

  2. is the host name (might just be domain name). Domain name is what is independently purchasable from a domain registrar. Host name can include additional info to the left: www.liu.edu indicates the domain is liu.edu, and www is the host portion. my.liu.edu indicates the same domain, but my is the host portion. Host name can also just be IP address, although it doesn’t always work.

  3. is the path. It indicates what resource, on that host, we would like to access.

An example with a non-HTTP protocol: tel:+17184881274 The protocol is “tel” which is for telephone.

HTTP is how your web browser requests resources from a web server. There are different “verbs” used:

  • GET – access/download the resource (view page)
  • POST – send some data that may have an effect (submit form)
  • others

There are also different response codes:

  • 200 means “OK”
  • 3xx is some sort of “redirect”
  • 400 means request was malformed
  • 403 means “forbidden”
  • 404 means “not found”
  • 5xx means server error

HTML is the language in which we specify the content and layout of web pages. It also can include CSS (for style) and JavaScript (for scripts).

HTML

Below is the code of a sample page that I demonstrated in class. Copy and paste it to a file saved with the .html extension (you can use Notepad, Notepad++, or TextEdit for this). Then you can edit and open in browser simultaneously. Save changes in the editor then refresh the browser.

You can see a live version of this page in your browser.

Miscellany

![@idiot on Twitter](idiot-404.png)