HTTP

Hypertext Transfert Protocol

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.

What’s in an HTTP request?

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:

  1. HTTP version type

  2. a URL

  3. an HTTP method

  4. HTTP request headers

  5. Optional HTTP body.

Source: Cloudflare.

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.

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

  • The HEAD method asks for a response identical to that of a GET request, but without the response body.

  • The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server.

  • The PUT method replaces all current representations of the target resource with the request payload.

  • The DELETE method deletes the specified resource.

  • The CONNECT method establishes a tunnel to the server identified by the target resource.

  • The OPTIONS method is used to describe the communication options for the target resource.

  • The TRACE method performs a message loop-back test along the path to the target resource.

  • The PATCH method is used to apply partial modifications to a resource.

Source: MDN.

Last updated