What is the Richardson Maturity Model?

Asked

Viewed 1,426 times

12

In a question I asked about HTTP was commented on the Richardson Maturity Model, from what I understand, it serves to define how semantic your server is relative to HTTP (if you use verbs and return the most appropriate status, for example)

Then an application that uses the verb POST to delete or update a server resource is not incorrect, but its maturity level is low

  • What is this model?

  • We must try to reach the highest level of maturity ever?

  • It is related to Apis REST only?

1 answer

6


What is this model?

It is a model created by Leonard Richardson that breaks the elements of a REST API on 3 levels. So for you to achieve the "real" REST you would have to reach level 3.

It is related to Apis REST only?

Yes

We must try to reach the highest level of maturity ever?

You must do what makes sense for your application. For this I will give a brief explanation of each level.

Level 0: HTTP

You use HTTP as a form of communication without any criteria for using verbs, or routes.

Level 1: HTTP + Resources

Your API is exposed (routed) by following the resource model. Like /users/ to list all users and /users/123/ to get a specific user.

Level 2: HTTP + Resources + Verbs

HTTP verbs are used semantically in your API. GET to read, POST to insert, PUT to replace a record, DELETE to delete...

Level 3: HTTP + Resources + Verbs + HATEOAS

Your API should return a list of resources (routes) with everything you can do from the original call.

GET /products/123 
{
  "id": 123,
  "name": "Orange"
  "links": [ 
    {"rel": "Suppliers", "href": "/suppliers/?product=123"}
  ]
}
  • What does that mean HATEOAS? It’s an acronym?

  • 2

    HATEOAS means "Hypertext as the engine of application state" -- See this other link in Stackoverflow for more information -- https://answall.com/questions/49492/por-que-hateoas-%C3%A9-important

Browser other questions tagged

You are not signed in. Login or sign up in order to post.