Networking

What is HTTP Header: request/response header?

Hi Ultimates! Hope you’re  going well, In our networking series we have learned How Data Travels Over Internet?TCP Header & 3-Way Handshake, now its time to go in depth with HTTP Header.

Everyday, you browse tons of pages on world wide web, Have you ever wondered how you get these pages or content delivered to your computer, here HTTP Header comes into play, behind the scenes.

If you look at your browser’s address bar that shows something that starts with “http://”, why it was there, so, Today we’re to going to discuss about HTTP Header. What they are? What they do?blah blah blah …….

Related: Networking Terms You Really Need To Know

HTTP “Hypertext Transfer Protocol”, the entire World wide Web uses this protocol, even IRON MAN uses this, LoL, almost everything you see in your browser is transmitted to your computer over HTTP.

 

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 field of the web browser. The browser parses the URL link into 3 parts:

Protocol: http://
Server Name: www.google.com
/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.

For example, when you opened teamultimate.in , your browser probably have sent over 40 HTTP requests and received HTTP responses for each.

HTTP headers are the core part of these HTTP requests and responses, and they carry information about the client browser, the requested page, the server and more.

Now come to HTTP request/response Header

http header
HTTP Request/Response Header

Image Credit: tutsplus.com

HTTP Request Header

 

When you type a url in your address bar, your browser sends an HTTP request and it may look like this:

 

GET /tcp-header-3-way-handshake/ HTTP/1.1

Host: teamultimate.in

User-Agent: Mozilla/6.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1.6) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729)

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language: en-gb,en;q=0.5

Accept-Encoding: gzip,deflate

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive: 300

Connection: keep-alive

Cookie: PHPSESSID=d3t5uvhq43gr4q5ib3vtdjq150

Pragma: no-cache

Cache-Control: no-cache

NOTE: your’s maybe different depending upon the Operating system, browser you are using and which page you’re browsing.

First line is the “Request Line” which contains some basic info on the request. And the rest are the HTTP headers.

HTTP Response Header

After that request, your browser receives an HTTP response that may look like this:

HTTP/1.x 200 OK

Transfer-Encoding: chunked

Date: Sat, 11 Feb 2017 03:46:55 GMT

Server: LiteSpeed

Connection: close

X-Powered-By: CloudFlare

Pragma: public

Expires: Sat, 11 Feb 2017 04:46:55 GMT

Etag: "pub1359456207;gz"

Cache-Control: max-age=3600, public

Content-Type: text/html; charset=UTF-8

Last-Modified: Sat, 11 Feb 2017 02:46:55 GMT

X-Pingback: http://teamultimate.in/xmlrpc.php

Content-Encoding: gzip

Vary: Accept-Encoding, Cookie, User-Agent

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>TCP Header And 3-Way Handshake - Ultimate Hackers</title>

<!-- ... rest of the html ... -->

The first line is the “Status Line”, followed by “HTTP headers”, until the blank line. After that, the “content” starts (the HTML output).

When you look at the source code of a web page in your browser, you will only see the HTML portion and not the HTTP headers, even though they actually have been transmitted together as you see above.

These HTTP requests are also sent and received for other things, such as images, CSS files, JavaScript files etc. That is why I said earlier that your browser has sent at least 40 or more HTTP requests as you loaded just this page.

Also Read: Open Systems Interconnection Model (OSI Model)

Now you’re introduced with HTTP Header, this will definitely help you in understanding our upcoming post.

If you want to learn more, refer to this Wikipedia article

Final Words

Hope you’ve enjoyed the post and learned about HTTP Header , why they are necessary, how they works, share this if you found useful, your share will appreciate my work and motivate me to post more, also subscribe to our mailing list to get the upcoming posts directly into your inbox.

Thanks. Keep Visiting. Keep Learning. Keep Exploring.


10 Comments

Click here to post a comment

Subscribe Now

Subscribe for free and get latest articles delivered right into your inbox.

Thank you for subscribing.

Something went wrong.

Categories

>-----ADVERTISEMENT-----<