REST (Representational State Transfer) is an architectural style for designing networked applications. RESTful APIs use HTTP methods to perform operations on resources.
REST API
An architectural style for building web APIs using HTTP methods and stateless communication.
REST Principles
- Stateless: Each request contains all needed information
- Client-Server: Separation of concerns
- Uniform Interface: Consistent resource naming
- Cacheable: Responses can be cached
HTTP Methods in REST
| Method | Purpose | Example |
|---|---|---|
| GET | Read data | GET /users |
| POST | Create new | POST /users |
| PUT | Update/Replace | PUT /users/1 |
| PATCH | Partial update | PATCH /users/1 |
| DELETE | Remove | DELETE /users/1 |
Code Examples
REST Endpoints
GET /api/users - List all users
GET /api/users/1 - Get user by ID
POST /api/users - Create user
PUT /api/users/1 - Update user
DELETE /api/users/1 - Delete userRelated Terms
HTTP Status Codes
Standard response codes that indicate the result of an HTTP request.
Read more
WebSocket
A protocol enabling full-duplex, real-time communication between client and server.
Read more
Latency
The time delay between a request being sent and a response being received.
Read more
Mock API
A simulated API endpoint that returns predefined responses for testing and development.
Read more