Beginner – Foundation · Module A
HTTP & the Web: The Absolute Basics
Requests, responses, methods, and status codes — the vocabulary everything else builds on.
What this session covers
- Every web interaction is a request-response pair: a client asks, a server answers — even a webpage load is just this repeated hundreds of times.
- The 5 methods worth knowing cold: GET (read), POST (create), PUT/PATCH (update), DELETE (remove).
- Status codes cluster by first digit: 2xx = success, 3xx = redirect, 4xx = you (the client) made a mistake, 5xx = the server made a mistake.
- Headers carry metadata (auth tokens, content type) separately from the body — mixing these up is a common early mistake when debugging.
Worked example
A customer says 'the API is broken'. You run `curl -i` against their failing call and see `HTTP/1.1 401 Unauthorized` with the header `WWW-Authenticate: Bearer error="invalid_token"`. The 4xx tells you it's a client-side problem, and the header tells you exactly which one: an expired token, not a server outage.
Exercises
- Run `curl -i https://httpbin.org/status/404` and `curl -i https://httpbin.org/status/503`. Explain to a non-engineer what each status means and who needs to act.
- Use `curl -i -X POST https://httpbin.org/post -H 'Content-Type: application/json' -d '{"name":"test"}'` and label the method, headers, body and status in the output.