Whitebeam Template Reference Documentation

Site Map
 
Home
 
Application Guide
Reference
  Installation
  Configuration
  XML Markup
  JavaScript Classes
  ROM
  Templates
  Environment
  Dev Process
  Tools
  External Links
  Example libraries
Community
Contact Whitebeam
To-Do
Download
Credits
Licence
Whitebeam Users
 
 
 

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 definitionThis 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 Headers

Accept*/*
Accept-Encodinggzip, deflate
Accept-Languageen-gb
ConnectionKeep-Alive
CookieRed60urne=TestContextId
Hostclient1
User-AgentMozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
Whitebeam release 1.3.36
(loadtime : 64ms)