Count

Returns the number of header entries in the HTTPHeaders Object.

Syntax

HTTPHeadersObject.Count

Where:

  • Count is Long (read)
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