REST API
Also called: REST, RESTful API
The most common style of web API: each thing has a URL, and HTTP methods say what to do with it.
Definition
In a REST API, an order lives at an address like /orders/1007. GET reads it, POST creates a new one, PUT or PATCH changes it and DELETE removes it, and the status code says how it went. Most apps you test talk to their server this way, usually sending and receiving JSON.
In practice
GET /orders/1007 returns the order as JSON with status 200; DELETE /orders/1007 returns 204.
Related terms
- APIThe way different software parts talk to each other, like an app asking a server for data.
- EndpointA specific API address the app calls, like GET /api/products or POST /api/login.
- HTTP methodThe type of request: GET reads data, POST creates, PUT/PATCH updates, DELETE removes.
- HTTP status codeA three-digit number in every server response: 200 means OK, 404 not found, 500 server error.
- JSONA simple text format for data, used by most APIs, like {"name": "Anna", "age": 31}.
- CRUDCreate, Read, Update, Delete: the four basic operations on stored data.