Search notes:

HTTP request methods

RFC 7231 describes the following (standardized) HTTP request methods:
GET Get the current representation of the target resource. («download»)
HEAD Same as GET but transfer status line and headers only.
POST Resource specific processing. A typical use case for POST is to transfer data (such as entered into <form> tag) to the web server («upload some data for processing»)
PUT Replace target or create new target with sent representation of resource («upload new resource»)
DELETE Remove target
CONNECT Create a tunnel
OPTIONS Describe communication options for the target resource
TRACE message loop-back test along the path to the target resource
GET and HEAD are required by a general-purpose web server, the other methods are optional.
The GET, HEAD, OPTIONS and TRACE methods are considered to be safe: they are essentially read only.

Difference between PUT and POST

PUT modifies a resource on the web server. Typically, data is sent with a PUT request that defines the content of the resource.
A POST does not modify such a resource, but rather uploads data for being processed by the web server.
A POST is sometimes used to create new resource, yet with a different URL than being used in the request.
In such scenarios, a PUT might be considered analogous to an SQL update statement and a POST to an insert statement.
If a new resource was created, the answer's status code typically is 201 Created.

Status codes

The status code 501 (Not Implemented) indicates that the server either does not recognize or has no implementation for the specific method.
405 (Method not allowed) indicates that the method is recognized and implemented, but not allowed for the requested resource.

See also

The method attribute of the HTML <form> element can be set to GET or POST and corresponds to the respective request method.
Command line executable curl:
In PHP, the request method can be queried with $_SERVER['REQUEST_METHOD'].
Serving POST requests in WSGI compliant applications

Index