top of page

What is a REST API?


In order to answer the question of what REST API is, you must first answer two separate questions. What is REST? What is an API? We will first discuss this from the point of view of a complex theory with a number of terms, and then we will show an example in human language. Let's start with REST.

REST stands for representational state transfer. It is a software architectural style that was created to guide the design and development of the architecture for the remotely distributed systems in the World Wide Web.

The six guiding principles or constraints of the RESTful architecture are:

Client-server architecture

The client-server model is a distributed application structure between the providers of a resource or service, called servers, and service requesters, called clients.

Statelessness

A stateless communication in which no session information is retained by the receiver, usually a server. Relevant session data is sent to the receiver by the client in such a way that every packet of information transferred can be understood in isolation, without context information from previous packets in the session.

Cacheability

As on the World Wide Web, clients can cache responses. Responses must define themselves as either cacheable or non-cacheable to prevent clients from providing stale or inappropriate data in response to further requests.

Layered system

A client cannot ordinarily tell whether it is connected directly to the end server or to an intermediary along the way.

Uniform interface

The uniform interface simplifies and decouples the architecture, which enables each part to evolve independently. The four constraints for this uniform interface are Resource identification in requests; Self-descriptive messages; Resource manipulation through representations; Hypermedia as the engine of the application state.

Code on demand

Servers can temporarily extend or customize the functionality of a client by transferring executable code

API An application programming interface (API) is a connection between computer programs. It is a type of software interface, that offers a service to other pieces of software.

REST API A web API that obeys the REST constraints is informally described as RESTful

Translated into human language. REST is a set of rules, principles, and guides for the development of web products. API is an interface, a connection between computer programs. An API that is developed with respect to REST principles is a REST API(also known as RESTful API).

But most people oversimplify things even more. They believe that if an API uses URL, HTTP requests, JSON, and HTTP Status Codes, it can be called a REST API. Whether it is correct or not is a separate question and let REST experts make a Holy War out of it. Instead of participating in it, we will give several examples of those APIs that are considered restful.





61 views

Recent Posts

See All
bottom of page