Understanding HTML RESTful web services
The web service created in Chapter 14 follows the most common approach, which is to return JSON data that the client can process and present to the user. This is the most flexible approach because it doesn’t limit the way that the data is used, allowing clients to be created that use data in ways the developers of the web service did not envisage and without their involvement.
For many projects, the developers of the web service are also responsible for the client, which leads to the strange situation where all of the state management features developed by the round-trip client are recreated, using a framework such as Angular or React to create a more responsive set of features.
In this situation, an alternative is to create a web service that returns fragments of HTML content instead of JSON, and create a client that responds to user interaction by sending HTTP requests to the web service, displaying the results that are obtained...