Clients specify the desired interaction method in the
Request-Line part of an HTTP request message.
RFC 2616 defines the
syntax as shown below:
Request-Line = Method SP Request-URI SP HTTP-Version CRLF
Each HTTP method has specific, well-defined semantics within the
context of a REST API’s resource model. The purpose of
GET is to retrieve a representation of a
HEAD is used to
retrieve the metadata associated with the resource’s state.
PUT should be used to add a new resource to a
store or update a resource.
removes a resource from its parent.
POST should be used to create a new resource
within a collection and execute controllers.
Tunneling refers to any abuse of HTTP that masks or misrepresents a message’s intent and undermines the protocol’s transparency. A REST API must not compromise its design by misusing HTTP’s request methods in an effort to accommodate clients with limited HTTP vocabulary. Always make proper use of the HTTP methods as specified by the rules in this section.
A REST API client uses the
method in a request message to retrieve the state of a resource, in some
representational form. A client’s
request message may contain headers but no body.
The architecture of the Web relies heavily on the nature of the
GET method. Clients count on being
able to repeat
GET requests without ...