HTTP defines a set of request methods to indicate the desired action to be performed for a given resource. Although they can also be nouns, these request methods are sometimes referred to as HTTP verbs. Each of them implements a different semantic, but some common features are shared by a group of them: e.g. a request method can be safe, idempotent, or cacheable.

1.GET

The HTTP GET method requests a representation of the specified resource. Requests using GET should only retrieve data.

Syntax:-
GET /index.html

Features:-
Request has body                                       No
Successful response has body                   Yes
Safe                                                            Yes
Idempotent                                                  Yes
Cacheable                                                   Yes
Allowed in HTML forms                               Yes

2.POST

The HTTP POST method sends data to the server. The type of the body of the request is indicated by the Content-Type header.

A POST request is typically sent via an HTML form and results in a change on the server. In this case, the content type is selected by putting the adequate string in the enctype attribute of the <form> element or the formenctype attribute of the <input> or <button>

Syntax:
POST /test

Features:-
Request has body                                      Yes
Successful response has body                  Yes
Safe                                                            No
Idempotent                                                 No
Cacheable                                                  Only if information included
Allowed in HTML forms                              Yes

3.PUT

The HTTP PUT request method creates a new resource or replaces a representation of the target resource with the request payload.

The difference between PUT and POST is that PUT is idempotent: calling it once or several times successively has the same effect (that is no side effect), whereas successive identical POST requests may have additional effects, akin to placing an order several times.

Syntax:-
PUT /new.html HTTP/1.1

Features:-
Request has body                                         Yes
Successful response has body                      No
Safe                                                               No
Idempotent                                                    Yes
Cacheable                                                     No
Allowed in HTML forms                                 No

4.HEAD

The HTTP HEAD method requests the headers that would be returned if the HEAD request's URL was instead requested with the HTTP GET method. For example, if a URL might produce a large download, a HEAD request could read its Content-Length header to check the filesize without actually downloading the file.

If the response to a HEAD request shows that a cached URL response is now outdated, the cached copy is invalidated even if no GET request was made.

Syntax:-
HEAD /index.html

Features:-
Request has body                                           No
Successful response has body                       No
Safe                                                                Yes
Idempotent                                                     Yes
Cacheable                                                      Yes
Allowed in HTML forms                                  No

5.DELETE

The HTTP DELETE request method deletes the specified resource.

Syntax:-
DELETE /file.html HTTP/1.1

Features:-
Request has body                                          May
Successful response has body                      May
Safe                                                                No
Idempotent                                                     Yes
Cacheable                                                      No
Allowed in HTML forms                                  No

6.CONNECT

The HTTP CONNECT method starts two-way communications with the requested resource. It can be used to open a tunnel.

For example, the CONNECT method can be used to access websites that use SSL (HTTPS). The client asks an HTTP Proxy server to tunnel the TCP connection to the desired destination. The server then proceeds to make the connection on behalf of the client. Once the connection has been established by the server, the Proxy server continues to proxy the TCP stream to and from the client.
CONNECT is a hop-by-hop method.

Syntax:-
CONNECT www.example.com:443 HTTP/1.1

Features:-
Request has body                                            No
Successful response has body                        Yes
Safe                                                                 No
Idempotent                                                       No
Cacheable                                                        No
Allowed in HTML forms                                    No

7.OPTIONS

The HTTP OPTIONS method requests permitted communication options for a given URL or server. A client can specify a URL with this method, or an asterisk (*) to refer to the entire server.

Syntax:-
OPTIONS /index.html HTTP/1.1
OPTIONS * HTTP/1.1

Features:-
Request has body                                            No
Successful response has body                        Yes
Safe                                                                  Yes
Idempotent                                                       Yes
Cacheable                                                        No
Allowed in HTML forms                                    No

8.TRACE

The HTTP TRACE method performs a message loop-back test along the path to the target resource, providing a useful debugging mech