Lets Know About REST API

If you are close to web development or software development there might high chance of you came across the word “REST API” or “RESTful API”. But what is this REST API?. Where it use?. How to develop it?

In this blog you will get some idea about REST API

History of REST

Prior to REST, developer user SOAP APIs to make call, developers handwrote an XML document with Remote Procedure Call in the body . Then they specify the endpoint and POST their SOAP enveloped to the endpoint. However, in 2000 REST API was introduced and defined by Roy Fielding.

After developer embraced to RESTful APIs, using them to add functionalities to their websites and application. Today, REST APIs are considered as the “backbone of the internet”.

What is API

An API (application programming interface) is a set of definitions and protocols for building and integrating application software. It’s sometimes referred to as a contract between an information provider and information user- establishing the content required from the consumer(API call) and the content required by the producer(API response).

The developer create the API on the server and allow the client to talk to.

What is REST

A REST API is conforms to the constraint of REST architectural styles and allows for interaction with RESTful web services. It stands for Representational state transfer. REST is a software architectural style which uses HTTP request to access and use the data.

For a example let’s say you are trying to find a shirt in ebay.com. You open up the eBay, and type “shirt” in the search bar, and hit enter. Then you can see a list of shirt are available about shirt. A REST is work similar way. When you search something and you will get a list back from the service you are requesting from.

How REST APIs Works

REST API breaks down a transaction to create a series of small modules. Each module addresses an underlying part of the transaction. This modularity provides developers with a lot of flexibility.

A REST API uses commands to obtain resources. The state of a resources at any given timestamp is called resource representation. A REST API uses existing HTTP methodologies. Such as

  • GET — Fetch a resource
  • POST — Insert new resource
  • PUT — Replace existing resource
  • DELETE — Remove a resource
  • OPTIONS — Get all allowed options
  • HEAD — Get only the response header

Data formats the REST API supports

  • application/json
  • application/xml
  • application/x-wbe+xml
  • application/x-www-from-urlencoded
  • multipart/form-data

REST API Architecture Constraint

  • Uniform Interface : Resources should be uniquely identifiable through a single URL , and only by using the underlying method of the network protocol, such as POST, PUT, GET with HTTP, should it be possible to manipulate a resource.
  • Client- server based : URL used to make connection between client and server. Client is portable and client does not have any connection to data server. Server stand independent from different user interfaces. HTTP stack is the communication platform.
  • Stateless : No client state on the server. Self containing messages. Each message contains sufficient information for that particular operation.
  • Cacheable : All the resources should allow caching unless explicitly indicated that caching is not possible.
  • Layered System : It organizes each type of server (those responsible for security, load-balancing, etc.) involved the retrieval o f requested information into hierarchies, invisible to the client.
  • Code-on- demand : The ability to send executable code from the server to the client when requested, extending client functionality.

Compliance with REST constraints

  • Performance
  • Scalability
  • Simplicity-Uniform interface
  • Modifiability -Change the component while running
  • Visibility -Communication between agents
  • Portability -Components, by moving program code with data
  • Reliability

Summary in brief



Undergraduate ,Software Engineering

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store