REST (Representational State Transfer) is an architectural style for developing web services that interact over HTTP. It treats every entity, such as a user, order, or file, as a resource accessible via a unique URL. Data is typically exchanged in JSON or XML formats.
Communication utilizes standard HTTP verbs to define actions:
- GET for retrieving resources;
- POST for creating new entries;
- PUT/PATCH for updating data;
- DELETE for removing resources.
How it works
REST relies on a stateless communication model, meaning the server does not retain client context between requests. This constraint improves scalability, as any server instance can handle any incoming request. Responses are explicitly marked as cacheable to reduce latency and server load.This architecture is the primary choice for mobile applications and cloud integrations. For example, a GET /v1/weather/london call returns current weather data in a structured format. Statistics indicate that REST remains the dominant choice for public-facing services, used by over 80% of developers due to its native compatibility with existing web infrastructure.