REST (Representational State Transfer) is described in the original dissertation as an "architectural style for distributed hypermedia systems." There are several key features of a REST API:
- It separates the client representation from the server data
- It is stateless
- It is cacheable
- It relies on a uniform interface, generally HTTP verbs
- It leverages a decoupled, layered system
Many people consider any API that uses a Universal Resource Indicator (URI) style to be REST by comparing it against other protocols like SOAP, AMF, or CORBA. REST, however, is specific to acting on resources using the correct HTTP verb. If you are performing some other action on the system, it's a Remote Procedure Call (RPC). The following table uses some examples to compare the two styles:
Operation | RPC style | REST style |
Login |
POST /login |
POST /session |
Logout... |