DelphiFAQ Home Search:

How can I read the HTTP response headers of the page?

 

comments2 comments. Current rating: 5 stars (1 votes). Leave comments and/ or rate it.

The browser object model doesn't provide access to these headers but in IE 5 and newer you have an ActiveX Object Microsoft.XMLDOM which can request the page and return the headers as shown below:

<script language="JavaScript" type="text/javascript">
<!--
var http = new ActiveXObject('Microsoft.XMLHTTP');

// display headers of current document:
http.open('HEAD', location.href, false);
http.send();
alert(http.getAllResponseHeaders())

// or display headers of yahoo.com:
http.open('HEAD', 'http://www.yahoo.com/', false);
http.send();
alert(http.getAllResponseHeaders())

//-->
</script>

Comments:

2006-08-16, 16:19:08
anonymous from United States  
rating
2008-04-18, 01:34:48
anonymous from India  
How to use this script? can you tell the complete procedure

 

 

Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option.
 
It seems that you are
from Washington, US .

Info/ Feedback on this

Show city and country
Show country only
Hide my location
Leave your comment here:
Please type in the code:
photo Add a picture:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity. The owner of this web site reserves the right to delete such material.