HTTP Request Headers
Hello Developer’s, in this article we are going to learn about HTTP Request, HTTP Response, Context and Headers.
fig. HTTP Request and HTTP Response
HTTP is Hyper Text Transfer Protocol which is Stateless protocol. Client means Browser sends requests to web server for web pages and images. After processing on request by server it sends back the response to client then connection between the client and server will disconnected.
HTTP Request contains the series of HTTP headers, header fields and message body. HTTP response contains a Status line, series of headers, a blank line and response body.
Context:
When end user sends request to server in the form of data, json and many more things than Server will process on that request and sends back to end user in the form of HTML. This single request and response called as Context.
Context = Request + Response
HTTP Headers:
fig. HTTP Headers
HTTP Headers pass more information between the client and server through the request and response headers. headers are case insensitive and it separated by colon (:).
There are two headers like Request headers and Response headers. In this Headers information like Content-Type: text/html, Date, Server, Accept-Encoding, Accept-Language and etc.
How to see Request and Response headers in Chrome using Developer tools:
First we have to run any website application, here I am running www.google.com web-site.
Press the Function button F12 or Right click on browser and click on Inspect(Ctrl + Shift + I).
Click on Network Tab:
fig. Network Tab
Again, Reload the website or webpage. Choose any HTTP request in left side panel and click on Headers Tab and you can see your Response and Request Headers in right side panel.
For example:
In General Section you can see your Request URL, Request Method, Status Code and etc.
fig. General
In Response Headers you can see the Content-Type, Date, Server and etc.
fig. Response Header
In Request Headers you see Accept, Accept-Encoding, Accept- Language, Cache Control and So many.
fig. Request Header
Sources:
w3.org
Wikipedia
developer.mozilla.org
Thanks for reading!