A REST (REpresentational State Transfer) Service is architectural style that allows integration between systems using a uniform interface.
A REST Service consists of collection of endpoints which can be called using HTTP Requests. A REST Service has a Base URI that all endpoint URIs extend. When a request is made to an endpoint, the server processes the request and returns an HTTP Response to the caller.
An HTTP Request consists of the following elements:
- An HTTP Method
- Headers that contain metadata about the request.
- Parameters
- A Body that contains data in the format required by the REST Service.
An HTTP Response consists of the following elements:
- Headers that contain metadata about the response.
- A Body that contains data in the format specified by the REST Service.
- A Status Code indicating the status of the request.
There are many REST Services with published APIs that make data and services readily available and can be consumed by your application to extend its functionality. For example:
- The Google Maps API offers geolocation functionality to over 5 million apps including Uber.
- The Skyscanner Flight API provides flight data to power searches for over 3000 travel agency apps.
- REST Countries API provides lists of formatted country codes. This API is widely used by developers for populating dropdown lists.