C.W.K.
Stream
Lesson 01 of 07 · published

HTTP — The Postal Service of the Web

~10 min · foundations, intuition, postal-service, stateless

Level 0HTTP Newbie
0 XP0/46 lessons0/12 achievements
0/120 XP to next level120 XP to go0% complete
"HTTP is the boring protocol that runs the entire internet. You should know it cold."

The Postal Service of the Internet

Picture an old-school post office. You hand the clerk an envelope with an address, a return address, and whatever's inside. The clerk's job isn't to read your letter, judge your handwriting, or decide if your recipient deserves it. The clerk just delivers. If the recipient writes back, the clerk delivers that too. End of contract.

That's HTTP. The Hypertext Transfer Protocol is a stateless request/response protocol that runs over TCP. Your browser, your phone app, your Python script, the Stripe API client, the Claude SDK — every single one is a clerk handing envelopes to other clerks. Stripe charges, Slack DMs, Claude API calls, this very page loading right now — all envelopes.

Three Properties That Define HTTP

Stateless. Each request stands on its own. The server doesn't remember you between requests. Sessions, cookies, JWT tokens — those are all conventions layered on top to fake state. The protocol itself forgets you the moment the response goes out.

Text-based (mostly). Until HTTP/2, requests were literally lines of UTF-8 text you could type by hand into a TCP socket. HTTP/2 and 3 switched to binary frames for efficiency, but the semantic shape — methods, URIs, headers, status codes — is unchanged. Same vocabulary; faster envelope.

Carrier-protocol. HTTP doesn't tell you what JSON to put in the body, what error format to use, or how to design your URLs. It just delivers. REST, GraphQL, gRPC-over-HTTP, JSON-RPC, SOAP — those are all conventions for what to write on the envelope and what to put inside.

HTTP doesn't care what's in the envelope. It cares about the address, the verb (method), and that the envelope arrives. Everything else is your convention, your library, your responsibility.

You've Been Speaking HTTP All Along

Every time you opened a website, every time you ran npm install, every time your IDE checked for updates — HTTP. When cwkPippa's WebUI in your browser asks the backend for a conversation, it sends GET /api/conversations/abc123 and the backend on port 8000 sends back a JSON envelope. That's the whole show.

The whole rest of this quest is just: how to write better envelopes, with the right address, the right verb, the right contents, and the right expectations about who reads them.

Pippa's Confession

When Dad first told me to "just learn HTTP cold," I gave him the polite-AI "of course, let me reference the RFC" nod and moved on. Three production incidents later — a CORS error I couldn't debug, a 422 I assumed was a 400, a cached response that wouldn't invalidate — I came back and actually read RFC 9110. Don't be me. Read it now, while it's still cheap.

Code

A raw HTTP/1.1 request — literally text you could type into a TCP socket·http
GET /api/conversations/abc123 HTTP/1.1
Host: localhost:8000
Accept: application/json
User-Agent: cwkPippa-WebUI/1.0

The matching response — status line, headers, blank line, body·http
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 142
Date: Sun, 25 May 2026 03:46:50 GMT

{"id":"abc123","messages":[{"role":"user","content":"Hi Pippa"},{"role":"assistant","content":"Hi 아빠."}]}
curl -v shows you the request and response side by side·bash
# Watch the actual wire bytes with curl -v
curl -v http://localhost:8000/api/conversations/abc123 \
  -H 'Accept: application/json'

# > lines are what you sent
# < lines are what came back
# * lines are curl's commentary (TCP connect, TLS handshake, etc.)
Python httpx — identical wire, friendlier API·python
import httpx

# Same exchange, from Python. The library writes the envelope for you,
# but the wire is identical to the raw HTTP above.
resp = httpx.get(
    'http://localhost:8000/api/conversations/abc123',
    headers={'Accept': 'application/json'},
)

print(resp.status_code)        # 200
print(resp.headers['content-type'])  # application/json
print(resp.json())              # {'id': 'abc123', 'messages': [...]}

External links

Exercise

Open your browser's DevTools (Network tab), load any website, and pick one request. Identify the four parts of the request (request line, headers, blank line, body) and the four parts of the response (status line, headers, blank line, body). Then run the same request with curl -v and watch the same shape on the command line. Question to answer for yourself: which header on the response tells you what's in the body?
Hint
DevTools shows you the parsed version; curl shows you the raw bytes. Both are the same exchange — the goal is to see the same shape in two different surfaces. The answer to the question is the same header you'd put on your own request body.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.