How many HTTP request methods are there

Hypertext Transfer Protocol

HTTP methods

Each client request is initiated by specifying the method. Methods determine the action of the request. The current HTTP specification provides eight methods: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE and CONNECT.

GET method

By far the most important method is GET. It is used to request a document or another source. A source is identified by the request URL. There are two types: conditional GET and partial GET. With the conditional GET type, the request for data is linked to conditions. The exact conditions are stored in the "Conditional" header field. Often used conditions are, for example, If-Modified-Since, If-Unmodified-Since or If-Match. With the help of this condition, the network load can be significantly reduced, since only the data that is actually required are transmitted. In practice, for example, proxy servers use this function to prevent the multiple transmission of data that is already in the cache.

The partial GET method pursues the same goal. It uses the range header field, which only transmits parts of the data, but which the client can still process. This technique is used to resume an interrupted data transfer.

POST method

The POST method takes the opposite route: it primarily transmits form entries to a web server. Commenting on existing sources, sending messages to forums and expanding online databases are also possible with POST. The data transmitted to the server are contained in the entity section. The POST method also sends a URL. In this case, this only serves as a reference as to which routine on the server handles the processing of the data.

OPTIONS method

This method enables the client to obtain information about available communication options. In this way, in particular, restrictions on sources on an HTTP server or even a proxy server can be determined without initiating a specific action or even transferring data.

HEAD method

This method is very similar to GET in the way it works. The only difference: HEAD only requests the header of a document or source. In contrast to GET, the server does not transmit the actual data. HEAD is particularly suitable for determining the size of sources, types or object attributes. In response to a HEAD request, the server transmits the meta information that is identical to the information in the GET request.

PUT method

This type allows the modification of existing sources or the creation of new data on the server. In contrast to the POST method, the URL in the PUT request identifies the data sent with the request itself, and not the source.

DELETE method

This type is used to delete data on the HTTP server that is identified by the URL. The interesting thing about this is that the deletion process does not have to take place immediately after the request has been received, but can also take place at a later point in time. According to the specification, the server should at least confirm acceptance of the request.

TRACE method

The client can use this method to track requests that run across multiple nodes. This is of particular interest when transmitting the request via one or more proxy servers. The last link in the chain generates the answer. The TRACE method is primarily used to diagnose client-server connections. The client uses the Max-Forwards header field to determine the maximum number of hops. All servers passed through are logged in the "Via" header field of the response message.

CONNECT method

The CONNECT method is reserved in the HTTP / 1.1 specification for connections in which proxy servers act dynamically as tunnels. In practice, it can be an SSL tunnel, for example. The tunnel mechanism is primarily intended as a passage for SSL-secured connections through a firewall. This method is already implemented in proxy servers such as MS Proxy, Netscape proxy server or WinGate. The client determines the target computer using the CONNECT method including the port specification. The proxy server then sets up a tunnel to the specified computer and transmits data and commands between client and server. Details on this procedure are specified in the Internet Draft "Tunneling TCP based protocols through Web proxy servers".