System Design
2. Networking FundamentalsAnimated
REST APIs
Resource-oriented APIs over HTTP using standard methods.
The idea
REST models things as resources with URLs and uses GET, POST, PUT, PATCH and DELETE with meaningful status codes.
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
- 1Name resources with nouns
- 2Use methods for actions
- 3Return proper status codes
- 4Keep the server stateless
Where it is used
Public and internal APIs.
Watch out for
Over-fetching and many round trips can hurt mobile clients.