Let’s understand what an API is

Mikel
7 min readApr 21, 2019
Photo by Nina Ž. on Unsplash

What is REST?

REST, REpresentational State Transfer, is a type of web development architecture that is fully supported by the HTTP standard.

REST allows us to create services and applications that can be used by any device or client that understands HTTP, so it is incredibly simpler and more conventional than other alternatives that have been used in the last ten years as SOAP and XML-RPC.

REST was defined in 2000 by Roy Fielding, co-author also of the HTTP specification. We could consider REST as a framework to build web applications respecting HTTP.

Therefore REST is the most natural and standard type of architecture to create APIs for Internet-oriented services.

There are three levels of quality when REST is applied in the development of a web application and, more specifically, an API that is collected in a model called Richardson’s Maturity Model in honor of the type that established it, Leonard Richardson, father of architecture oriented to resources.

These levels are:

  1. Correct use of URIs.
  2. The correct use of HTTP.
  3. Implement Hypermedia.

In addition to these three rules, you should never save state on the server, all the information that is required to show the information that is requested must be in the query by the client.

By not saving state, REST gives us a lot of play, since we can scale better without having to worry about issues such as storage of session variables and even, we can play with different technologies to serve certain parts or resources of the same API.

Level 1: Correct use of URIs

When we develop a web or a web application, the URLs allow us to access each of the pages, sections or documents of the website.

Each page, information in a section, file, when we talk about REST, we name them as resources.

The resource is, therefore, the information that we want to access, modify or eliminate, *regardless of its format*.

The URL, Uniform Resource Locator, is a type of URI, Uniform Resource Identifier, which, in addition to allowing to identify…

--

--