0% found this document useful (0 votes)
32 views

Restful Webservices:: Richardson Maturity Model

The Richardson maturity model grades APIs according to REST constraints with four levels from 0-3. Level 0 uses a single POST method for all requests. Level 1 exposes resources with URIs. Level 2 uses different HTTP methods like GET and DELETE. Level 3 adds support for HATEOAS and self-documentation.

Uploaded by

mukul_mangla
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Restful Webservices:: Richardson Maturity Model

The Richardson maturity model grades APIs according to REST constraints with four levels from 0-3. Level 0 uses a single POST method for all requests. Level 1 exposes resources with URIs. Level 2 uses different HTTP methods like GET and DELETE. Level 3 adds support for HATEOAS and self-documentation.

Uploaded by

mukul_mangla
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

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).

There are four levels:

Level 0: The Swamp of POX

Level 1: Resources

Level 2: HTTP Verbs

Level 3: Hypermedia Control

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.

To get the data: http://localhost:8080/customer

To post the data: http://localhost:8080/customer

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.

For example, if we want a list of specific products, we go through the URI


http://localhost:8080/products. If we want a specific product, we go through the URI
http://localhost:8080/products/mobile.

Level 2: HTTP Verbs

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: Hypermedia Controls

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.

You might also like