Introducing REST, API, JSON, and XML
Data presented to users can come from different sources. It can be hardcoded into an app, but that comes with limitations. To change hardcoded data, we have to publish an update to our app. Some data, such as currency exchange rates, the real-time availability of assets, and the current weather, cannot be hardcoded by its nature. Other data may become outdated, such as the terms of use of an app.
In such cases, you usually fetch the relevant data from a server. One of the most common architectures for serving such data is representational state transfer (REST) architecture. REST architecture is defined by a set of six constraints: client-server architecture, statelessness, cacheability, a layered system, code on demand (optional), and a uniform interface.
Note
To read more about REST, visit https://packt.link/YsSRV.
When applied to a web service application programming interface (API), we get a Hypertext Transfer Protocol (HTTP)-based...