Introduction to REST
REST is an architectural guideline for building a web service. Primarily, it defines a set of constraints that can be followed while designing a web service. One of the key principal REST approaches recommends that APIs should be designed around resources and should be media- and protocol-agnostic. The underlying implementation of the API is independent of the client consuming the API.
Considering an example of our e-commerce application, let's say we are searching for a product on the UI using a product's search field. There should be an API that is created for products, and here, products are nothing but a resource in the context of an e-commerce application. The Uniform Resource Identifier (URI) for that API could be something like this, which clearly states that we are trying to perform a GET operation on product entities:
GET http://ecommerce.packt.com/products
The response of the API should be independent of the client that is calling the...