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 …….
What is HTTP Header ?
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:
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
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
User-Agent: Mozilla/6.0 (Windows; U; Windows NT 6.1; en-GB; rv:184.108.40.206) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729)
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
Date: Sat, 11 Feb 2017 03:46:55 GMT
Expires: Sat, 11 Feb 2017 04:46:55 GMT
Cache-Control: max-age=3600, public
Content-Type: text/html; charset=UTF-8
Last-Modified: Sat, 11 Feb 2017 02:46:55 GMT
Vary: Accept-Encoding, Cookie, User-Agent
html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>TCP Header And 3-Way Handshake - Ultimate Hackers</
<!-- ... 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.
- You can use Firebug Extension for Firefox Browser to analyze HTTP Header
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
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.