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 where data is exchanged in plain text format, usually when the exchanged data is simple and there is no need for using JSON records. Due to the way a RESTful service works, it should have an architecture that follows the next principles:
- Client-server design
- Stateless implementation—this means that each interaction does not depend on others
- Cacheable
- Uniform interface
- Layered system
According to the HTTP protocol, you can perform the following operations on an HTTP server:
POST
, which...