7 Creating REST services

 

This chapter covers

  • Defining REST endpoints in Spring MVC
  • Automatic repository-based REST endpoints
  • Consuming REST APIs

“The web browser is dead. What now?”

Several years ago, I heard someone suggest that the web browser was nearing legacy status and that something else would take over. But how could this be? What could possibly dethrone the near-ubiquitous web browser? How would we consume the growing number of sites and online services if not with a web browser? Surely these were the ramblings of a madman!

Fast-forward to the present day, and it’s clear that the web browser hasn’t gone away. But it no longer reigns as the primary means of accessing the internet. Mobile devices, tablets, smart watches, and voice-based devices are now commonplace. And even many browser-based applications are actually running JavaScript applications rather than letting the browser be a dumb terminal for server-rendered content.

With such a vast selection of client-side options, many applications have adopted a common design where the user interface is pushed closer to the client and the server exposes an API through which all kinds of clients can interact with the backend functionality.

7.1 Writing RESTful controllers

7.1.1 Retrieving data from the server

7.1.2 Sending data to the server

7.1.3 Updating data on the server

7.1.4 Deleting data from the server

7.2 Enabling data-backed services

7.2.1 Adjusting resource paths and relation names

7.2.2 Paging and sorting

7.3 Consuming REST services

7.3.1 GETting resources

7.3.2 PUTting resources

7.3.3 DELETEing resources

7.3.4 POSTing resource data

Summary

sitemap