What is HTTP?

ยท

2 min read

The Hypertext Transfer Protocol (HTTP) is the foundation of the World Wide Web, and is used to load webpages 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 requesting a server, which sends a response message.

What is 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

What is an HTTP method?

An HTTP method, sometimes referred to as an HTTP verb, indicates the action that the HTTP request expects from the queried server. HTTP methods are POST, GET, PUT, PATCH, and DELETE.

What are HTTP request headers?

HTTP headers contain text information stored in key-value pairs, and they are included in every HTTP request and response. These headers communicate core information, such as what browser the client is using and what data is being requested.

What is in an HTTP request body?

The body of a request is the part that contains the body of information, the request is transferring. The body of an HTTP request contains any information added as a payload.

What is an HTTP response?

An HTTP response is what web clients receive from an internet server in answer to an HTTP request. These responses communicate valuable information based on what the client is asking for.

A typical HTTP response code contains:

  1. an HTTP status code

  2. HTTP response headers

  3. optional HTTP body

What is an HTTP status code?

HTTP status codes are 3-digit codes most used to indicate whether an HTTP request has been successfully completed. Status codes are broken into the following 5 blocks.

  1. 1xx information

  2. 2xx Success

  3. 3xx Redirection

  4. 4xx Client Error

  5. 5xx Server Error

The xx refers to different number between 00 and 99.

Did you find this article valuable?

Support Make api calls like a pro ๐Ÿ˜Ž by becoming a sponsor. Any amount is appreciated!

ย