Restful Webservices:: Richardson Maturity Model
Restful Webservices:: Richardson Maturity Model
The Richardson maturity model is a way to grade your API according to the constraints of REST. It breaks
down the principal element of the REST approach into four levels (0 to 3).
Level 1: Resources
For example, a level higher is more RESTful compared to one that is at a lower level. Only when an API
reaches level 4, we consider it as a RESTful API.
Level 0
Level 0 is also known as POX (Plain Old XML). At level 0 it does not take the advantages of HTTP like
different HTTP methods, and HTTP cache. To get and post the data, we send a request to the same URI,
and only the POST method may be used.
To do any of the operations like get, delete, update, we use the same POST method.
Level 1: Resources
When an API can distinguish between different resources, it might be at level 1. It uses multiple URIs.
Where every URI is the entry point to a specific resource. It exposes resources with proper URI.
We don't use a single POST method for all requests. We use the GET method when we request a
resource and use the DELETE method when we want to delete a resource. Also, use the response codes
of the application protocol.
For example, to get the customers, we send a request with the URI http://localhost:8080/customers,
and the server sends proper response 200 OK.
Level 3 is the highest level. It is the combination of level 2 and HATEOAS. It also provides support for
HATEOAS. It is helpful in self-documentation.
For example, if we send a GET request for customers, we will get a response for customers in JSON
format with self-documenting Hypermedia.