REST API
An architectural style for APIs that uses HTTP requests to access and use data.
REST APIs use standard HTTP methods: GET (read), POST (create), PUT (update), and DELETE (remove). They are widely used due to their simplicity and ability to be cached. Unlike SOAP, REST is not a protocol but a set of architectural principles. It is the backbone of modern web and mobile application communication.
graph LR
Center["REST API"]:::main
Rel_apache_http_server["apache-http-server"]:::related -.-> Center
click Rel_apache_http_server "/terms/apache-http-server"
Rel_microservices["microservices"]:::related -.-> Center
click Rel_microservices "/terms/microservices"
classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
linkStyle default stroke:#4b5563,stroke-width:2px;
🧒 Explain Like I'm 5
A REST [API](/en/terms/api) is like a standardized way for computers to talk to each other. It's like a set of global hand signals: if a program does 'thumbs up' (GET), it wants information; if it does 'thumbs down' (DELETE), it wants to remove something.
🤓 Expert Deep Dive
REST architecture, as defined by Roy Fielding, is based on resource identification through URIs. It must maintain statelessness (no client context stored on server) and support layered systems (proxies/gateways). Key features include HATEOAS (Hypermedia as the Engine of Application State), where the server provides links to further actions. Error handling is standardized via HTTP status codes (2xx, 4xx, 5xx). Security is typically managed via OAuth2 or JWT (JSON Web Tokens).