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 toGET
requests except that the body of the response is not transmitted. This method is useful for obtaining meta-information about resources. Similar to theOPTIONS
method, this method is usually...