A REST API (Representational State Transfer) is a style of web API in which each resource, such as a user or an order, has its own URL and clients act on it with standard HTTP methods. Requests are stateless, meaning the server keeps no client session between calls.
Why it matters
REST is the most common way to build web APIs because it reuses what HTTP already provides: methods, status codes, headers and caching. Developers can explore a REST API with nothing more than a browser or curl, and load balancers and CDNs understand its traffic.
Example
| Method | URL | Meaning |
|---|---|---|
| GET | /orders | List orders |
| POST | /orders | Create an order |
| GET | /orders/17 | Read order 17 |
| PUT | /orders/17 | Replace order 17 |
| DELETE | /orders/17 | Remove order 17 |
A successful create typically returns 201 Created, and a missing order returns 404 Not Found.
Common mistakes
- Putting verbs in URLs such as
/getOrder, instead of using the HTTP method. - Returning
200 OKwith an error in the body, so clients and monitors cannot detect failure. - Calling any JSON-over-HTTP API "REST" even when it ignores resources and status codes.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.