An introduction to REST
Most modern web applications work by exposing their APIs and allowing clients to use these APIs to interact and communicate with them. Although REST is not tied to HTTP, most web services use HTTP as their underlying protocol. Additionally, although REST can work with any data format, usually REST means JSON over HTTP because most of the time, data is exchanged in JSON format in RESTful services. There are also times when data is exchanged in plain text format, usually when the exchanged data is simple and there is no practical need for JSON records. Due to the way a RESTful service works, it should have an architecture that follows the subsequent principles:
- Client-server design
- Stateless implementation (each interaction does not depend on previous ones)
- Cacheable
- Uniform interface
- Layered system
According to the HTTP protocol, we can perform the following operations on an HTTP server:
POST
: This is used...