Once you have identified all the resources, as the next step, you may want to map the operations defined on the resources to the appropriate HTTP methods.
The most commonly used HTTP methods (verbs) in RESTful web APIs are POST
, GET
, PUT
, and DELETE
. Note that there is no one-to-one mapping between the CRUD operations defined on the resources and the HTTP methods.
Note
An operation is called idempotent if multiple identical requests produce the same result. Similarly, an idempotent RESTful web API will always produce the same result on the server irrespective of how many times the request is executed with the same parameters; however, the response may change between requests. The HTTP methods—GET
, HEAD
, PUT
, and DELETE
—are all idempotent, while POST
is not.
Here are some tips for identifying the most appropriate HTTP method for the operations that you want to perform on the resources: