🌐 API & Integration · APIs & Integration
REST
An HTTP-based style commonly used to expose resources.
Use familiar HTTP methods and resource-oriented URLs.
GET /customers/10 reads a customer; PATCH updates selected fields.
💡 Think of nouns and verbs: the URL is the noun (the thing) and the HTTP method is the verb (what you do to it).
💡 Why it matters
REST is widely understood, so an API that follows its conventions is easy for other developers to learn and use. Using the right HTTP method also signals intent clearly — GET is safe to repeat, DELETE removes. Following the style keeps APIs predictable and tool-friendly.
🛠️ How to achieve it
⚠️ Signs of trouble
- •URLs contain verbs like /getCustomer or /deleteOrderNow.
- •GET requests change data on the server.
- •Everything is a POST regardless of intent.
- •Status codes are always 200, even on errors.
🎯 Quick check
Score: 0/3Three questions to test the idea.
1. In REST, how should a URL be structured?
Answer: Around a resource noun, like /customers/10
REST models resources as nouns in the URL and lets the HTTP method express the action.
2. Which HTTP method should be used to read data safely?
Answer: GET
GET is for reading and should not change data, so it can be safely retried or cached.
3. Why return meaningful status codes?
Answer: So callers can tell success from failure and react
Status codes like 200, 404 and 400 tell the caller what happened so it can handle each case correctly.
