|
Whitebeam Template Reference Documentation
|
System Template
iterateHeader()
Access the contents of HTTP headers presented by the remote browser.
Syntax
headerinfoIterator = rb.page.iterateHeader()
Parameters
The 'iterateHeader' method takes no parameters
Results
The System Template will create an iterator that allows the Pattern Page to step through each
of the headers presented by the browser. This gives almost raw access to the headers enabling pages
finer granularity of control over there input. This is also the only mechanism to deal with situations in
which there may be more than one instance of a specific header. Once the iterator has been created the 'getNextRow()' method can be used to access each header in turn.
Type/Value | Range/Length | Description |
struct headerinfo |
see definition | This method returns an Whitebeam 'Iterator' object. This object is then used
to step through each of the HTTP headers in turn.
|
Remarks Searches for a named HTTP header and returns the contents of the header (if present) to the Pattern Page. Example
rb.page.write('<h1>HTTP Headers</h1>\n');
var iter = rb.page.iterateHeader();
rb.page.write('<table border="1">\n');
while (iter.getNextRow()) {
rb.page.write('<tr><td>'+iter.name+'</td><td>'+iter.value+'</td></tr>\n');
}
rb.page.write('</table>\n');
The typical output produced by this code fragment would be as follows: HTTP HeadersAccept | */* | Accept-Encoding | gzip, deflate | Accept-Language | en-gb | Connection | Keep-Alive | Cookie | Red60urne=TestContextId | Host | client1 | User-Agent | Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) |
|
|
(loadtime : 98ms) |