Not every service that is exposed over HTTP is compliant with the REST constraints. Sometimes one can find services, which are advertised as being RESTful, but in reality, they follow the RPC style. In fact, there may even be a grey zone between REST and RPC (see article on “What is API-Design”), when a service implements some features of REST and some of RPC. The Richardson Maturity Model can be used for determining the degree to which services are RESTful. The following levels are defined:

Richardson Maturity Model
Richardson Maturity Model

According to its definition, the REST style requires level 3, which is in fact HATEOAS. I have studied a well-known API that does a decent job in following the HATEOAS principle.

However, typically people speak about REST services, even if only levels 1 or 2 are reached. REST at levels 1-2 is sometimes called “pragmatic REST” or “REST-like APIs”. Here are a couple of simple, practical tricks to determine if a service is not RESTful:

  • If the name of the service is a verb instead of a noun, the service is likely RPC and not RESTful.
  • If the name of the service to be executed is encoded in the request body, the service is likely RPC and not RESTful.
  • If the back-button in the web-application does not work as expected, the service is not stateless and not RESTful.
  • If the service or website does not behave as expected after turning cookies off, the service is not stateless and not RESTful.

Learn all about RESTful API Design in my new book.

Richardson Maturity Model – classify REST-like APIs

Also published on Medium.

Tagged on:     

Matthias Biehl

As API strategist, Matthias helps clients discover their opportunities for innovation with APIs & ecosystems and turn them into actionable digital strategies. Based on his experience in leading large-scale API initiatives in both business and technology roles, he shares best practices and provides both strategic and practical guidance. He has stayed a techie at heart and at some point, got a Ph.D. Matthias publishes a blog at api-university.com, is the author of several books on APIs, and regularly speaks at technology conferences.