Home / HTTP / What is HTTP request/response header?
http header

What is HTTP request/response header?

World Wide Web commonly known as Web is a collection of electronic hyper text documents stored in a computer linked together like a spider’s web which can be accessed via internet. The web browser is a software program that acts like a computer program e.g firefox, chrome, safari (Web clients). In a day 3.3 billion searches happen on google search index. HTTP header plays an important role in browsing information from web servers.

Keep in mind that HTTP header fields are components of the header section of request and response messages in the Hypertext Transfer Protocol (HTTP).

Let’s understand what happen when you type http://www.google.com/index.html in url of the web browser. The browser parses the URL link into 3 parts:

  1. Protocol: http://
  2. Server Name: www.google.com
  3. / index.html: path of the page

When this passed URL comes out of the browser it becomes HTTP Request.
The request is forwarded to the server and server send HTTP Response against particular request in the same way.

HTTP defines the protocol of how your internet browser communicates with a web server. Because your internet browser and web server agreed to implement the same protocol, they are able to communicate.
When you enter http://www.google.com in your browser’s address bar and press return,
the following steps describe what happens on a high level:
• Your browser extracts the domain name from the URL, www.google.com.
• Your computer sends a DNS request to your computer’s configured DNS servers.
DNS can help resolve a domain name to an IP address, in this case it resolves to
216.58.201.228.

Tip: You can use cmd on your system to find the IP address of any website e.g www.google.com.
• Your computer tries to set up a TCP connection with the IP address on port 80,
which is used for HTTP traffic.

Tip: you can set up a TCP connection by running nc 216.58.201.228 80 from your terminal.
• If it succeeds, your browser will send an HTTP request like:
GET / HTTP/1.1
Host: www.google.com
Connection: keep-alive
Accept: application/html, */*
• Now it will wait for a response from the server, which will look something like:

HTTP/1.1 200 OK
Content-Type: text/html
<html>
<head>
<title>Google.com</title>
</head>
<body>

</body>
</html>
• Your browser will parse and render the returned HTML, CSS, and JavaScript. In this
case, the home page of Google.com will be shown on your screen.

Learn more about hacking.

About Kamran Mohsin

Kamran Mohsin
Kamran Mohsin is a Certified Ethical Hacker. Currently working as a Penetration Tester within a private company in Pakistan. He is also doing Masters in information Security. He worked in web development (front-back-end) from recent back years. With the passage of time he took interest in Hacking and started to write blogs on IS from late 2015.

6 comments

  1. Avatar

    Well nice explanation!

  2. Avatar

    This is easy to understand, nice article.

  3. Avatar

    Nice piece of work. Thanks

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: