What is the REST API?

In this lesson, we will learn about REST and understand its basics.

We'll cover the following

What is REST?

REST, or Representational State Transfer, is an architectural design that defines a set of rules for creating web services that interact between systems. Web services that follow this architecture are termed, ‘RESTful web services’.

At a very high level, the RESTful system consists of two major components:

  • A server that hosts the resources

  • A client that connects to the server to fetch the resources

REST uses HTTP (Hypertext Transfer Protocol) or HTTPS (Hypertext Transfer Protocol Secure) to exchange data between client and server using HTTP methods – GET, POST, UPDATE, DELETE, HEAD, PATCH, etc.

Benefits of using REST

By following the principles of REST, we can benefit from the loose coupling between the server and the client, reliability, scalability, and better performance of the application. Few of the benefits of REST are listed below:

  • Simplicity – REST web services are easy and simple to develop compared to SOAP web services

  • Light-weight – REST advocates simple communication with the server over HTTP that supports plain XML, JSON formats in comparison to SOAP which supports only XML

  • Architecture is similar to Web --the architecture of REST is very similar to how the web is designed. So, developers who understand the web can easily understand and develop RESTful web services

  • Scalability – the REST architecture advocates refraining from the conversational state that allows us to easily add multiple instances of the components or application behind load balancers

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy