The Hypertext Transfer Protocol (HTTP) is the foundation of the World Wide Web, and is used to load web pages using hypertext links. HTTP is an application layer protocol designed to transfer information between networked devices and runs on top of other layers of the network protocol stack. A typical flow over HTTP involves a client machine making a request to a server, which then sends a response message.
An HTTP request is the way internet communications platforms such as web browsers ask for the information they need to load a website.
Each HTTP request made across the Internet carries with it a series of encoded data that carries different types of information. A typical HTTP request contains:
HTTP version type
an HTTP method
HTTP request headers
Optional HTTP body.
What’s an HTTP method?
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.
GET method requests a representation of the specified resource. Requests using
GET should only retrieve data.
HEAD method asks for a response identical to that of a
GET request, but without the response body.
POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server.
PUT method replaces all current representations of the target resource with the request payload.
DELETE method deletes the specified resource.
CONNECT method establishes a tunnel to the server identified by the target resource.
OPTIONS method is used to describe the communication options for the target resource.
TRACE method performs a message loop-back test along the path to the target resource.
PATCH method is used to apply partial modifications to a resource.