Tuesday, August 15, 2017

What is Web API and why to use it ? What is REST?

The API is stand for "Application Program Interface" and web we commonly use for internet application so Web API means the service or interface or endpoint which available on internet to retrieve and update application data for the client.

Here client means general it can be Web Client , Mobile Client  etc etc possible on all available operating system.

Web Clients means all browsers like Internet Explorer, Google Chrome , Safari, Opera etc
Mobile Client means iPhone,iPad , Android Phones and tablets or Windows Phones and tablets

Today creating web application is not enough because Mobile devices like Phones and Tablets are so popular to reach maximum people so you need to design application which make data available across all possible clients.

Let's consider modern application architecture which has several clients on different platforms including Mobile and Web Clients.



If you can notice all client apps are having it's own bussiness logic to connect with database and process data accordingly. This architecture is complex to scale and enhance application. Adding single business rule change  also we need to add in all available business logic which introduce more defects,bugs and expensive also.

Now let's consider same application with central API along with common business layer.


Each clients are using common Application Program Interface and common business layers which will advantage over previous modern architecture.Now days creating Web API we are creating with one architecture pattern called REST and services which are following these pattern called as RESTfull services.

What is REST?
REST stands for ‘Representational State Transfer’ and it is an architectural pattern for creating an API that uses HTTP as its underlying communication method.

Almost every device that is connected to the internet already uses HTTP; it is the base protocol that the internet is built on which is why it makes such a great platform for an API.

HTTP is a request and response system; a calling client sends a request to an endpoint and the endpoint responds. The client and endpoint can be anything but a typical example is a browser accessing a web server or an app accessing and API.

No comments:

Post a Comment