Aptitude · Tech basics
Web, HTTP and APIs, made easy
💡 The idea
A web request is a method + an address: GET /books/7 means “fetch book 7”. The reply comes with a status code that says how it went.
Method (GET, POST…)→Address (/books/7)→Status (200, 404…)
🧭 The method: 3 steps
- GET reads, POST creates, PUT replaces, PATCH changes part, DELETE removes.
- Status: 2xx worked, 3xx moved, 4xx your request is wrong, 5xx the server failed.
- REST addresses are nouns: /customers/7/orders/42, and the method gives the action.
🎬 Every kind of question, in pictures
Pick a kind. Guess the answer first, then watch the picture work it out. Tap any step to see it in the picture.
Loading the pictures…
✏️ Worked examples
Example 1. Best address to delete order 42 of customer 7?
- Action comes from the method: DELETE
- Address names the thing: /customers/7/orders/42
⚡ Shortcut: DELETE /customers/7/orders/42
⚠️ Where people go wrong
- Verbs in addresses (/getOrders): the method already says the action.
- 401 (not signed in) vs 403 (signed in, but not allowed).
- PUT replaces everything; PATCH changes only what you send.
📌 Remember
- GET POST PUT PATCH DELETE
- 2xx ok · 4xx you · 5xx server
- Plural nouns, nested ids