To promotion development of technology for business, finance, sell and health electrical, computer, electronics, software, hardware, programming, interfacing

18Jul/110

learn about a HTTP Header

A HTTP Header is request to a server about information and give resulting response. if you give  input an address to your browser, it will send requesting to the server hosting.

instruction of HTTP header consist of two, like this following:

1. HEAD

if we send requesting HEAD to the server(example google.com), it will  send only header information in this following:

HEAD / HTTP/1.0

Host: google.com

Connection: Close

we will recieve response from server(google.com) like this following:

HTTP/1.0 301 Moved Permanently
Location: http://www.google.com/
Content-Type: text/html; charset=UTF-8
Date: Tue, 19 Jul 2011 05:33:21 GMT
Expires: Thu, 18 Aug 2011 05:33:21 GMT
Cache-Control: public, max-age=2592000
Server: gws
Content-Length: 219
X-XSS-Protection: 1; mode=block

 

2. GET

This instruction will give response like following:

  1. Response status; 200 is a valid response from the server.
  2. Date of request.
  3. Server details; type, configuration and version numbers. For example the php version.
  4. Cookies; cookies set on your system for the domain.
  5. Last-Modified; this is only available if set on the server and is usually the time the requested file was last modified
  6. Content-Type; text/html is a html web page, text/xml an xml file.

 

if we send requesting GET to the server(example to url www.google.com), it will  send only header information in this following:
GET / HTTP/1.0
Host: google.com
Connection: Close

 

we will recieve response from server(example to url www.google.com) like this following:

HTTP/1.0 301 Moved Permanently

Location: http://www.google.com/

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

Date: Tue, 19 Jul 2011 02:45:10 GMT

Expires: Thu, 18 Aug 2011 02:45:10 GMT

Cache-Control: public, max-age=2592000

Server: gws

Content-Length: 219

X-XSS-Protection: 1; mode=block
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8"><TITLE>301

Moved</TITLE></HEAD><BODY><H1>301 Moved</H1>The document has moved<A

HREF="http://www.google.com/">here</A>.</BODY></HTML>

 

Content of files that are not text based will be displayed in their encoded form.  you will not see an image (.jpeg) but the  encoding will be displayed. For text based files including web pages (.html, .htm, .php .asp, .xml) will displayed in HTML , and Cascading Style Sheets (.css), JavaScript (.js) will be direct displayed. Or  The content displayed is the same as displayed when using View Source in a browser.