Home Next-Gen Security Hypertext Transfer Protocol (HTTP)

Hypertext Transfer Protocol (HTTP)


Hello, Hackers,

Let’s talk from a very basic.

Well, we all visit different search engines and search for various things and access them, but do you really know how it works in the background? So let’s start with the very initial and I will explain what HTTP is and how this works in the background to facilitate us or serve us web pages that we browse.

Tables of contents

  • What is HTTP
  • How does HTTP work?
  • What is HTTPs ?
  • HTTP 1.0 vs HTTP 1.1
  • HTTP methods
  • HTTP response code

Hypertext Transfer Protocol (HTTP)

HTTP(Hypertext Transfer Protocol), is an application-level protocol which is responsible to transfer data on the internet. It has a group of rules that a server needs to follow when it involves the transmission of files (images, videos, audio, and other types of files) through the World Wide Web (www).

How does HTTP work?

HTTP simply follows a Client-Server architecture. HTTP can also be called as request-response protocol. In this, a web browser 1st initiates a request to a server, typically by opening a TCP/IP connection. When the response has been completed, either the browser or the server may terminate the TCP/IP connection or the browser can send another request.

In simple terms, the Client ( web browser ) requests to the server for a particular resource that he/she wants to access, This is called HTTP Request. This request is transmitted to the server via a TCP/IP connection and received at the server end. Then the server looks for that particular resource. Once found, it gives the requested resource back to the client via the same TCP/IP connection. that was established before, which is called HTTP Response.

What is HTTPS ?

HTTPS means the use of HTTP along with SSL (Secure Socket Layer) protocol or TLS (Transport Layer Security). TLS is the advanced version of SSL. Both are transport-layer protocols. These protocols can be used to create a secure connection between two machines. The client uses SSL or TLS to securely connect to a website (Server) indicated by an HTTPS URL. that is a URL with the prefix “https://“. The browser then uses HTTP to send and receive requests over this secure connection.

If you have noticed the above picture, you can clearly see why https is more secure than http. In HTTP every data transmitted among client and server is in clear text format. that an attacker can easily read or trap.

Whereas in HTTPS, The data transmission occurs through a secure channel. where each data was encrypted. even if someone hacks the data, he is not able to read the data because it was encrypted.

HTTP 1.0 vs HTTP 1.1

The key difference between HTTP 1.0 and HTTP 1.1 is that:
In HTTP 1.0 you had to open a fresh connection for each request/response pair. And, after each response, the connection will be closed. Resulting in very slow network.

On the other hand, HTTP 1.1 allows to have persistent connections. That means we can have more than one request/response on the same HTTP connection. which speed up the data transfer.

As this is a basic chapter, we will not go to deep comparision, Soon you will get a detailed comparison post on my blog.

HTTP methods

HTTP utilizes specific request methods in order to communicate with the server for performing various tasks

GET: is to retrieve information from the server in the form of an entity.
POST: is used to send data to the server.
HEAD: is identical to GET. But here the server didn’t return any message body. This is used to transfers the status line and header section only.
OPTION: is to show users which HTTP methods are available for a specific URL.
PUT: is used to update an existing resource on the server.
TRACE: it echoes the received request so that a client can see if any changes or additions have been made by servers.
DELETE: is used to delete an avaliable resource from the server.

HTTP Response Codes

HTTP status codes are sets of numbers that explain what is happening during the transfer process between the client (or the browser) and the server. The codes are sometimes referred to as browser error codes or internet error codes.
There are 5 categories:

  • 1xx Status Codes: Information Request –  indicate that a server is processing information and hasn’t fully completed the request yet
  • 2xx Status Codes: Success – show that a request has been completed and the transfer happened as planned.
  • 3xx Status Codes: Redirection – indicate that the client has requested information that is no longer at the provided address and the address has changed from A TO B.
  • 4xx Status Codes: Client Error – indicate that a problem has occurred on the client side.
  • 5xx Status Codes: Server Error – indicate that something is wrong on the server-side.



Please enter your comment!
Please enter your name here

Exit mobile version