RESTful constraints:
- Client-server: separate clients and servers. Rationale: separation of concern;
- Stateless server: each request from a client contains all the information necessary to service the request. Rationale: scalability;
- Cacheable: clients can cache responses, responses must indicate if this is allowed. Rationale: efficiency;
- Uniform interface: there is a uniform interface between clients and servers;
- Layered System: must allow concepts such as load balancers, proxies and firewalls. Rationale: load balancing, encapsulation of legacy services;
- Code-On-Demand (optional): client can request code from server and execute it;