What is REST API and how it work?

What is REST API and how it work?

By Krishna

Either you're frontend developer or a backend developer, you need to know about REST API(S). They is a way to make communication between the frontend and the backend of the applications.

What is REST API?

Let's understand it with restaurant example. If you visit a place for food, you interact with the waiter to order your food.

How it Work?

Restaurant Example:

The key persons are you (Frontend), waiter(Rest API), and the restaurant (Backend). You give your food order to the waiter, wait for your order and it's delivered to you.

An example is the courier service. In this case, the sender send something and that something is delivered at the doorstep of the reciever and end the sender gets a message of successful deliver.

Courier Example

In this case the sender is Frontend, receiver being the backend and the courier service being used is the Rest API.

There is a term CRUD stands for create, read, update, and delete that's often used when talking about Rest API.

CRUD Operations

The Rest API allows you to create, read, update, and delete data from the database using backend server.

Rest API working as communication between two servers, share the details and the instructions.

If you make a visit to the following link: https://api.github.com/users/khattakdev

Real Example

You'll see a JSON format data.

Here's what happened: 1. You type the URL 2. The Frontend makes a request 3. The Backed parses the request based on the data received from Frontend 4. The Backend returns the JSON data

Step by step

Other Stories

How to use the Together App for video calls

How to download YouTube  video to MP4?