Chapter 5. CRUD Operations in REST

In Chapter 3, The First Endpoint, we created our first RESTful endpoint to access rooms in our sample property management system. Requests to retrieve data are typically mapped to the HTTP GET method in RESTful web services.

Now, we will expand on this previous example and implement the remaining endpoints to support all CRUD (Create, Read, Update, and Delete) operations.

In this chapter, we will cover the following topics:

  • Mapping CRUD operations to HTTP methods
  • Creating resources
  • Updating resources
  • Deleting resources
  • Testing RESTful operations
  • Emulating PUT and DELETE methods

Mapping CRUD operations to HTTP methods

The HTTP 1.1 specification defines the following methods:

  • OPTIONS: This method represents a request for ...

Get Building a RESTful Web Service with Spring now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.