Basic Description
The Word REST stands for Representational State Transfer which is nothing but the technology that is generally preferred to more robust simple object access protocol (SOAP) Technology. Robust because it leverages less bandwidth usage and hence more suitable for internet usage.An API ( Application Programming Interface ) for a website or an app is a code that allows two software programs to communicate with each other. It is the program that requests the hosted services.
An API is required when we want to consume the services that are running or hosted on the other web servers rather than installing the huge redundant hardware devices as per the demand that fulfills our purpose. This can be understood by the following examples:
As we are creating the weather app for the mobile device. Now the app needs to be dynamic, that is the weather needs to change as per the environment. That we need to have some sensors to collect the data for weather. Also, there can be one approach that we install sensors at different locations across the globe for collecting the data. This will be very costly if we go like this. The second approach can be contacting some vendor/service provider that can share the required weather information.
Now as our app is ready that means we have a ready design for use and we just need some data to make the response dynamic. We can get that data from the other hosted servers dedicated for this purpose using communication interfaces such as REST API`s.
Data Format
Now the data we receive from other serves need to have some specific format that is structured so that it can be easily understood.In case of REST API, this data format can be JSON(JavaScript Object Notation) or XML(Extensible Markup Language).
Communication Using REST API
