#
HTTP request methods
This tutorial explains to you the HTTP request methods.
HTTP defines a set of request methods to indicate the desired action to be performed for a given resource.
The HTTP request methods are: GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS, CONNECT, TRACE.
#
GET request methods
- is used to retrieve data from the server (should only retrieve data !)
- idempotent: YES
Info
An HTTP method is idempotent
if the intended effect on the server of making a single
request is the same as the effect of making several identical requests.
#
POST request methods
- creates a new resource on the server
- idempotent: NO (each POST create another resource)
#
DELETE request methods
- remove a resource from the server
- idempotent: YES
#
PUT request methods
- creates a new resource or replaces a representation of the target resource with the request payload
- idempotent: YES
#
PATCH request methods
- similar to the PUT method, but the request body only needs to contain the specific changes to the resource
- idempotent: YES (excepting some particular cases, for instance when the resource keeps the number of updates, the last date of update, etc. )
#
HEAD request methods
- asks for a response identical to that of a GET request, but without the response body
- idempotent: YES
#
OPTIONS request methods
- requests information about the communication options available for the target resource
- idempotent: YES
#
CONNECT request methods
- starts two-way communications with the requested resource. It can be used to open a tunnel.
- idempotent: NO
#
TRACE request methods
- debugs web server connections
- idempotent: YES