Lesson 1
What happens when you open a web page?
Follow one request from your browser to a server and back. Then try each HTTP method against a live mock API and test yourself. Use the Beginner / Advanced switch at the top to change how deep the explanations go.
Unit 1
The request journey
The big picture. Opening a web page is like phoning a shop to order something:
- Look up the shop's phone number. (DNS)
- Dial and wait until someone picks up. (TCP)
- Check it's really that shop, then switch to a private line. (TLS)
- Say what you want. (HTTP request)
- The shop gets it ready. (server processing)
- They hand it over with a note saying "OK". (HTTP response)
- You unpack it, notice a few missing pieces and ask for those too. (render)
Under the hood. One page load goes through four protocol layers. Each layer relies on the one below it:
HTTPMethods, headers, status codes. HTTP/1.1 and h2 run over TLS + TCP; HTTP/3 runs over QUIC.
TLS 1.3Encryption and proof of the server's identity. Certificates, ECDHE, ALPN.
TCPA reliable, ordered stream of bytes. Replaced by QUIC (over UDP) in HTTP/3.
IPMoves packets to an address. DNS turns names into these addresses.
Press Play to watch the whole trip, or click a stage to replay just that part.
On the wire
Unit 2
HTTP methods
The method is the verb of a request: it says what you want to do to a resource. Below is a tiny bookshelf API. Pick a method, press Send, and watch what happens to the server's data. Press Send twice to see which methods are idempotent.
Safe = only reads, never changes data. Idempotent = doing it twice has the same effect as doing it once.
Client
Server
Request
Response
(press Send)
Server data: /api/books
| id | title | read |
|---|
Unit 3