An HTTP method is the action label attached to a request between a client and a web server. In a REST-style API, URLs identify the nouns—such as a song or user—while methods act as verbs for working with them. This lets an API reuse HTTP rather than inventing a separate web protocol. section 11.1.1 section 11.5
REST commonly maps CRUD actions to HTTP methods like this:
- GET reads or fetches content. section 11.5
- POST creates content; it may also modify content in some APIs. section 11.1.1 section 11.5
- PUT updates an object by sending all of its fields. section 11.1.1
- PATCH updates an object by sending only changed fields. section 11.1.1
- DELETE removes content. section 11.1.1 section 11.5
These mappings are conventions, not rules enforced by REST. POST, PUT, and PATCH can be used differently by an API, so a client needs to know both the supported methods and the payload format before making requests. JSON and XML are common payload formats. section 11.1.1 section 11.5
Updating a resource
Suppose an API exposes a resource at a URL. A PUT request supplies the resource’s complete set of fields for an update, whereas a PATCH request supplies only fields that changed. The URL identifies what is being updated; the method signals the intended operation. section 11.1.1 section 11.5
Figure 11.2 GET, POST, PUT, PATCH, and DELETE: HTTP methods for CRUD actions
Compare GET, POST, PUT, PATCH, and DELETE against the CRUD actions they conventionally express. section 11.1.1









