ResponseHeaders

Header Object which gives access to individual response headers.

Syntax

HTTPObject.ReponseHeaders

Where:

  • ResponseHeaders is an Object (read)
Example

This script will print out the name of the HTTP server:

Function Main

Dim HTTPObj as Object

Dim headers as Object

ip = "www.apache.org"

port = 80

cr = Chr(13) + Chr(10)

Set HTTPobj = HTTP.Connect (ip,port)

'Set up the request type

HTTPobj.GetURL("/")

HTTPobj.verb = "HEAD"

'to pass through the proxy with automatic authentication

'Authentication needs to be set to 1

HTTPobj.Authentication = 1

'Send the HEAD request

HTTPResponse = HTTPobj.SendRequest ()

'Set new Object called headers

Set headers = HTTPobj.ResponseHeaders

'HTTPResponse contains the return code

echo "Result: " + cstr(HTTPResponse) + cr

'the http result will look something like :

'HTTP/1.1 200 OK

'Server: Microsoft-IIS/5.0

'Date: Tue, 28 Oct 2003 10:23:19 GMT

'Content-Length: 1270

'Content-Type: text/html

echo "Server running on " + ip + " is " + headers.HeaderValue("server") + cr

End Function