REST APIs
An architectural style for designing networked APIs around resources.
CurrentbeginnerBeginner-friendlyFull course available
Overview
REST (Representational State Transfer) is a set of architectural conventions -- resources identified by URLs, standard HTTP methods (GET/POST/PUT/DELETE) for actions, and stateless requests -- that most web APIs follow, even if not perfectly 'RESTful' by the original academic definition.
- What it is
- A convention for designing HTTP APIs around resources, URLs, and standard HTTP methods.
- Why it's used
- It's the most widely understood API convention, backed by HTTP itself, requiring no additional protocol layer.
- Where it fits
- The design layer between a frontend and backend, or between two backend services, regardless of the specific framework implementing it.
Core concepts
- Resources and URLs
- HTTP methods (GET, POST, PUT, DELETE)
- Status codes
- Statelessness
- JSON as the typical payload format
Example
The URL identifies the resource (a specific book); the HTTP method identifies the action -- this consistency is what makes REST APIs predictable to use without reading custom documentation for every endpoint.
GET /api/books/42 -> fetch one book
POST /api/books -> create a book
PUT /api/books/42 -> replace book 42
DELETE /api/books/42 -> delete book 42Common use cases
- Any client-server communication over HTTP
- Public and internal service APIs
Project ideas
- Design (on paper) the REST endpoints for a simple to-do app: list, create, update, delete