HTTP Request Methods

HTTP request methods indicate the desired action to be performed on the given resource.

Types of Request Methods

"Getter" methods
  • GET Requests a representation of the target resource.

  • HEAD Identical to GET, but requests for the headers only (no body).

"Setter" methods
  • POST Requests the target resource to process the given data according to its semantics.

  • PUT Creates or replaces the state of the target resource with the given data.

  • DELETE Deletes the target resource.

  • PATCH Applies partial modification to the resource (e.g. replace only the "name" field of a user).

Other methods
  • OPTIONS Requests information about the communication options available for the target resource (you can specify a URL or * to refer to the entire server). This method allows a client to determine the options and/or requirements associated with a resource, without implying a resource action.

  • CONNECT Requests that the recipient establish a tunnel to the destination origin server (intended only for proxies, usually for SSL connections). When succesful, the proxy will no longer blindly forward packets (in both direction) until the tunnel is closed (i.e., it will only forward data through the tunnel?).

  • TRACE Requests a loop-back of the request message. The final recipient of the request should reflect the message received with 200 (OK) and Content-Type: message/http. (Used to see what is received at the other end of the request chain, bearing in mind that proxies can also alter data.)

References