3. Client and Server
1
The picture to keep in your head2
3.1 What exactly are a client and a server?3
3.2 What's a request and a response?4
3.3 What happens when you type a URL and press Enter?5
3.4 What do GET, POST, PUT, PATCH and DELETE mean?6
3.5 What do status codes tell you?7
3.6 What goes in the headers and what goes in the body?8
3.7 What's the difference between TCP and UDP?9
3.8 How does HTTPS keep the conversation private?10
3.9 Why do keep-alive, HTTP/2 and HTTP/3 make things faster?11
3.10 What does "stateless" mean, and why do we want it?12
3.11 How do cookies, sessions and tokens remember who you are?13
Memory card and where the analogy breaks14
Practice: five levels15
Interview questions16
Solutions17
Sources18
Code lab3. Client and Server
Sources
3 min read+10 XP
Source notes
- HTTP methods, safety and idempotency, status codes (including 401, 403, 502, 503, 504): RFC 9110, HTTP Semantics. PATCH: RFC 5789. 429 Too Many Requests: RFC 6585.
- HTTP/1.1 persistent connections: RFC 9112. HTTP/2 multiplexing: RFC 9113. HTTP/3: RFC 9114. QUIC: RFC 9000.
- TLS 1.3 full handshake in one round trip: RFC 8446.
- TCP three-way handshake: RFC 9293. UDP: RFC 768.
- Cookies and the
Set-CookieattributesHttpOnlyandSecure: RFC 6265.SameSiteis defined in the cookie specification updates (RFC 6265bis drafts) and implemented by major browsers. - JSON Web Token: RFC 7519.
- Round-trip numbers in Level 2 are assumptions; arithmetic computed 2026-10-05.
- Level 3 and Level 4 code: tested 2026-10-05 (
code/ch03_client_server.py, all checks pass).