HeaderName

HeaderName retrieves the name of the header from the HTTPHeader Object.

Syntax

HeaderName (LONG index)

The valid range for index between 0 and the number of headers.

Returns

A String containing the name of the header.

Example

This script will print the headers:

Function Main

Dim HTTPObj as Object

Dim headers as Object

ip = "www.gfi.com"

port = 80

cr = Chr(13) + Chr(10)

Set HTTPobj = HTTP.Connect (ip,port)

'Set up the request type

HTTPobj.GetURL("/")

HTTPobj.verb = "HEAD"

'Send the HEAD request

HTTPResponse = HTTPobj.SendRequest ()

'Set new Object called headers

Set headers = HTTPobj.ResponseHeaders

'headers.count contains the number of headers (long)

echo "header count: " & CStr(headers.Count) & cr

upbound = headers.Count - 1

'for each header, echo back the HeaderName and Header value

For hn=0 To upbound

echo headers.HeaderName(hn) & vbTab & "-->" & vbtab & headers.HeaderValue(hn) & cr

Next

End Function