Book Image

Building a RESTful Web Service with Spring

By : Ludovic Dewailly
Book Image

Building a RESTful Web Service with Spring

By: Ludovic Dewailly

Overview of this book

Table of Contents (17 chapters)
Building a RESTful Web Service with Spring
About the Author
About the Reviewers

Mapping CRUD operations to HTTP methods

The HTTP 1.1 specification defines the following methods:

  • OPTIONS: This method represents a request for information about the communication options available to the requested URI. This is, typically, not directly leveraged with REST. However, this method can be used as part of the underlying communication. For example, this method may be used when consuming web services from a web page (as part of the cross-origin resource sharing mechanism).

  • GET: This method retrieves the information identified by the requested URI. In the context of RESTful web services, this method is used to retrieve resources. As illustrated in Chapter 3, The First Endpoint, this is the method used for read operations (the R in CRUD).

  • HEAD: These requests are semantically identical to GET requests except that the body of the response is not transmitted. This method is useful for obtaining meta-information about resources. Similar to the OPTIONS method, this method is usually...