System Design
10. API Design and ManagementAnimated
RESTful API Design
Resources, URLs and standard HTTP methods.
The idea
Nouns in URLs, verbs as methods, status codes for outcomes, and stateless requests.
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 (/orders/42)
- 2Use GET, POST, PUT, DELETE
- 3Return clear status codes
- 4Keep requests self-contained
Where it is used
Public and internal web APIs.
Watch out for
Verbs in URLs and returning 200 for errors.