Architecturerestful apirepresentational state transferrest api

REST

Definition

REST (representational state transfer) is an architectural style for networked APIs built on resources identified by URLs, a uniform interface of HTTP methods, stateless requests and cacheable responses.

In practice

REST over HTTP works everywhere: browsers, curl, proxies and CDNs understand it, and JSON is easy to read and debug. Standard semantics carry real meaning: GET is safe and cacheable, PUT and DELETE are idempotent, and status codes such as 404 or 429 tell clients how to react.

Text encoding is larger and slower to parse than binary formats, and there is no built-in schema, so contracts need OpenAPI or similar. Many "REST" APIs are really RPC over HTTP, which is fine as long as method semantics are respected: a GET that changes state breaks caches and retries.

Example

GET /orders/81 returns 200 with the order as JSON, PATCH /orders/81 changes its address, and DELETE /orders/81 returns 204; repeating the DELETE is safe.