What is the Richardson Maturity Model and what are its four levels?

Answer

The Richardson Maturity Model (RMM), introduced by Leonard Richardson, describes the degree to which an API adheres to REST principles in four levels. Level 0 (The Swamp of POX): HTTP is used as a tunnel for RPC — all calls go to a single endpoint via POST with an XML or JSON body specifying the action. SOAP APIs are at Level 0. Level 1 (Resources): individual resources have their own URLs (/users/42) but only one HTTP method (usually POST) is used for all operations. Level 2 (HTTP Verbs): correct HTTP methods (GET, POST, PUT, DELETE) are used along with meaningful status codes. Most well-designed REST APIs today are at Level 2. Level 3 (Hypermedia Controls / HATEOAS): responses include hyperlinks to related actions, making the API self-descriptive. The client navigates the API by following links rather than constructing URLs. Level 3 is the true REST as defined by Fielding and is rarely implemented fully in practice, but Level 2 is widely accepted as "RESTful".