13 Tweets Jan 31, 2023
Everyone knows REST APIs.
But how to grade your API to get to know whether it's truly REST or not?
Let's talk about Richardson Maturity Model. ๐Ÿงต
Richardson Maturity Model is the way to grade your API based on the constraint of REST.
Richardson Maturity Model has four levels.
Level 0 โ€“ย POX Swamp
Level 1 โ€“ URI
Level 2 โ€“ HTTP Verbs
Level 3 โ€“ Hypermedia
If your API is on level 3 (Hypermedia) according to Richardson Maturity Model then your API is truly REST API.
Let's discuss four levels of the Richardson Maturity Model individually. ๐Ÿ‘‡๐Ÿป
๐Ÿ“Œ Level 0 โ€“ POX Swamp
Richardson Maturity Model starts with level 0.
At this level:
โ€ข API calls should be RPC
โ€ข Each API uses an HTTP mechanism for interaction
โ€ข Plain Old XML(POX) as the data format
๐Ÿ“Œ Level 1 โ€“ URI
URI stands for Uniform Resource Identifier.
You can grade your API to level 1 if users can access multiple resources via URIs and the HTTP POST method.
๐Ÿ“Œ Level 2 โ€“ HTTP Verbs
In level 1 we introduced resources.
You can put your API on level 2 if it has options to manipulate resources using different HTTP Verbs.
We can perform different operations on resources that are not possible just using the POST HTTP method.
๐Ÿ“Œ Level 3 โ€“ Hypermedia
You might have noticed that all the levels we discussed above are quite general, and most REST APIs follow that.
But Hypermedia or HATEOAS is something that makes your API truly REST.
HATEOAS stands for Hypermedia As The Engine Of Application State.
HATEOAS defines that clients should be provided with hypermedia, in response to a particular request, which helps them to use or explore further points of an API.
Level 3 makes your API resources more discoverable and self-descriptive.
So is your API at level 3 on the Richardson Maturity Model?
If not, implement HATEOAS and make your API truly REST.
With that said, that's pretty much it for this thread.
Follow @Rapid_API for more exclusive content. ๐Ÿ™๐Ÿš€

Loading suggestions...