Vilson Castilho

What is a RESTful API?

Hey guys.

Today I'm going to briefly talk about what a RESTful API is.

First, what is an API?

Application Programming Interface (API), is basically a set of routines, standards and functionalities that serve to provide relevant data and information of a given application, which can also be consumed by other applications.

So the API in a simple way is responsible for establishing communication between different services, in addition to intermediating the exchange of information between the client and the server.

What is REST?

Representational State Transfer (REST), is an architecture style that consists of a set of best practices and standards based on HTTP (Hyper Text Transfer Protocol) requests, which is the protocol responsible for determining the standards and defining the rules in the exchange of information between the server and the computer.

The REST API increases performance for concurrency situations, that is, many simultaneous requests. It uses verbs to define the purpose of the request being made. The main verbs are:

  • GET: request used to receive a resource saved in a database;
  • POST: request used to create a resource in a database;
  • PUT: request used to update a complete resource saved in a database;
  • PATCH: request made to update only one resource information;
  • DELETE: request made to delete a resource from a database.
  • Although the body of the request and return may use other formats, in general, the JSON format (JavaScript object notation format) is used as standard. This format is chosen mainly for its compatibility between existing languages and frameworks.

    After all, what is a RESTful API?

    Combining the previously explained information, we can finally conceptualize a RESTful API as an API capable of providing data in a standardized format, requiring all elements of the REST architecture.

    Thank you and let's code!!! 👨‍💻