An http request is a class consisting of
HTTP styles requests, request lines, request methods, request URL, header
fields and body content. The most common methods that are used by a client in
an HTTP request are as follows.
Ø
GET
Used when the client is
requesting a resource on the web server. The GET method is the simplest and
most frequently used request method. It is used to access the static resource,
such as HTML documents and images. GET request can be used to retrieve dynamic
information by including query parameters in the request URL.
Ø
HEAD
Used when the client is
requesting some information about a resource but not requesting the resource
itself.
Ø
POST
Used when the client is
sending information or data to the server – for example filling out an online
form (ie. Sends large amount of data to the server)
Ø
PUT
When the client is sending
a replacement document or uploading a new document to the web server under the
request URL.
Ø
DELETE
Used when the client is
trying to delete a document from the web server, identified by the request URL.
Ø
TRACE
Used when the client is
asking the available proxies or intermediate servers changing the request to
announce themselves.
Ø
OPTIONS
Used when the client wants
to determine other available methods to retrieve or process a document on the
web server.
Ø
CONNECT
Used when the client wants
to establish a transparent connection to a remote host, usually to facilitate
SSL-encrypted communication (HTTPS) through an HTTP proxy.
Ø
PATCH
It is used to apply partial
modifications to a resource.