A Beginner's Introduction to REST



In this Blog post I will give a simple and slight introduction to a very popular topic in the world of Application Programming Interface, REST API. In the previous post I have simply explained what is an API. In here I will focus on one of the most popular subset Web API's standard architecture style in the present - REST API.

First things first, let's look into what a WEB API is,
    It's simply a concept to an API that can be accessed using HTTP protocol like GET, POST, PUT,   
    DELETE, PATCH.

REST or Representational State Transfer has few features:
  • It's Stateless - which means the State of the service does not rely on the previous requests or responses sent to that same service. 
  • REST is a Client-Server Protocol.
  • It treats server objects as Resources that can be created, updated or deleted. These resources are identified by a Uniform Resource Identifier (URI).
  • It's lightweight, scalable  and maintainable.
  • Represents the resource object as either as an XML, YAML and most commonly JSON.
REST is also an Architecture Style that defines a way to make uniform API calls from REST-full web service interfaces.

There are a series of rules or constraints for the server so that everyone who uses the service understands and knows about how it works. These constraints include the following:
  • Uniform Interface - Based on the HTTP specification. URI refers to the resource and HTTP verb/method refers to the action performed.
  • Stateless
  • Client-Server - URI makes the connection between the client and the server. Clearly separated the user interface and the service.HTTP stack is the communication platform.
  • Cachable - Data that doesn't change very frequently and for how long it is good is determined.
  • Layered System - Client only knows the URI. Doesn't see the underlying complexities of the service.
These are the basics to know about REST services or API's in a nutshell. 


Comments