System Design
2. Networking FundamentalsAnimated
HTTP
The request-response protocol of the web.
The idea
A client sends a method, path and headers; the server replies with a status code, headers and body. HTTP itself is stateless.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- current message
- earlier
- failure or attack
A request names a method, a path and headers.
- step:
- 1/4
- from:
- Client
- to:
- Server
1/4
Time runs downward. Solid arrows are requests, dashed arrows are replies.
Step by step
- 1Client opens a connection
- 2It sends a request such as GET /page
- 3Server returns a status and body
- 4Connection is reused or closed
Where it is used
Web pages and APIs.
Watch out for
Statelessness means state must be carried by cookies, tokens or a database.