You are here: Home / Past Courses / Fall 2015 - ECPE 177 / Projects / Example HTTP Headers

Example HTTP Headers

Google Chrome can show you both the HTTP request sent from the browser to the server, and the reply from the server to the browser.

  1. Right-click on a page and choose "Inspect Element"
  2. Select the "Network" tab in the inspection panel at the bottom
  3. Load a new page or reload the current page.
  4. The network tab should populate with a list of files that were downloaded for that page. Select a file, perhaps the first file in the list (the HTML file)
  5. Select the "Headers" tab in the sub-panel
  6. You should see both "Request Headers" (from browser to server) and "Response Headers" (from server to browser).  Click on "view source" next to each to view the raw text instead of the "view parsed" mode that it defaults to.
 
What is missing from this view?
  1. The carriage return / line feed characters (\r\n) at the end of each header line
  2. The extra blank line  (\r\n) at the end of all the headers
  3. In the Response Headers, the payload (HTML file, image, CSS, etc...) that immediately follows the headers. 

 

Chrome Inspect Element HTTP Headers
Chrome Inspect Element - HTTP Headers

 

Example Headers

For the URL http://ecs-network.serv.pacific.edu/ecpe-177:

From Client to Server:

GET /ecpe-177 HTTP/1.1\r\n
Host: ecs-network.serv.pacific.edu\r\n
Connection: keep-alive\r\n
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\r\n
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36\r\n
Referer: http://ecs-network.serv.pacific.edu/logged_out\r\n
Accept-Encoding: gzip,deflate,sdch\r\n
Accept-Language: en-US,en;q=0.8\r\n
Cookie: <omitted>\r\n
\r\n 

From Server to Client:

HTTP/1.1 200 OK\r\n
Date: Wed, 17 Sep 2014 01:44:21 GMT\r\n
Server: Zope/(2.13.22, python 2.6.5, linux2) ZServer/1.1\r\n
Expires: Sat, 01 Jan 2000 00:00:00 GMT\r\n
Content-Type: text/html;charset=utf-8\r\n
X-Ua-Compatible: IE=edge,chrome=1\r\n
Content-Language: en\r\n
Vary: Accept-Encoding\r\n
Content-Encoding: gzip\r\n
Content-Length: 3160\r\n
Keep-Alive: timeout=5, max=98\r\n
Connection: Keep-Alive\r\n
\r\n
<<DATA GOES HERE>>