Skip to main content
>_ supraj.dev
TOPIC NETWORKING
HTTP the protocol the web speaks
IN 10 SECONDS

A request-response protocol where your browser sends a method (`GET`, `POST`) + path + headers, and the server replies with a status code (`200`, `404`, `500`) plus a body. HTTP/2 and 3 add multiplexing and server push on top.

GOTCHA `301` vs `302` vs `307` — the browser caches 301s permanently. Use 302/307 for temporary redirects or you'll break future changes.
HOW A REQUEST FLOWS
01 Client resolves DNS, then opens a TCP connection to the server's IP on port 80 (or 443 for HTTPS).
02 Client sends a request line like `GET /api/users HTTP/1.1` followed by headers and optionally a body.
03 Server processes the request and returns a status line like `HTTP/1.1 200 OK` with response headers and body.
04 Client reads the response; the connection is either kept alive (HTTP/1.1) or reused (HTTP/2) for the next request.
POKE IT YOURSELF
curl -I https://supraj.dev — fetch just the response headers
curl -v https://api.example.com — see the full request/response exchange