Skip to content

Latest commit

 

History

History
45 lines (29 loc) · 1.92 KB

File metadata and controls

45 lines (29 loc) · 1.92 KB

HTTP

Outcome

You'll:

  • Understand some of the finer points of HTTP

Advice

HTTP is the 'protocol' used to load webpages. It's a standard agreed by a bunch of people with neck beards come up with, developers who do httpy stuff (Firefox / Chrome developers etc.) then follow those standards.

It's worth noting that HTTP is Synchronous, so when you fire off a HTTP request, you wait for the response, there is a persistent connection. If your internet is disrupted in the mean time, you'll most likely get an error.

HTTP calls can return data in many any file format. e.g:

You can invoke HTTP over the command line. The two most popular are curl and wget. Curl is a pain to use: this helps me. Try curl -XGET 'http://www.google.co.uk'.

Redirection is quite important, it's very common to do these redirects

Learning materials

Core

Tasks

  • Read the primer but stop at the section: Request and Response Message Formats
  • Questions (answers on a postcard!)
    • Draw a sample url from memory and label each bit.
    • What happens if you specify no port on your url? e.g. http://google.com
    • Do me two query parameters: name which should be "john" and age which should be 20.
    • What verbs are there?
    • Which verb does a web browser when you load a page?
    • What goes into a request?
    • What is in a response?