|
Whitebeam Template Reference Documentation
|
System Template
getHeader()
Access the contents of HTTP headers presented by the remote browser.
Syntax
string = rb.page.getHeader(headerName)
Parameters
The 'getHeader' method takes 1 parameter:
Name | Type/Value | Range/Length | Description | headerName | string | | Required.
Specifies the name of the requires HTTP header.
|
Results
The System Template will search the HTTP headers looking for a header with the specified name. If the
header successfully found the method returns a string containing the value passed from the browser. If browser has NOT provided the requested header then this result of the method will be the JavaScript
'void' value.
Type/Value | Range/Length | Description |
string |
  | The contents of the HTTP header if presented by the browser. NOTE if the header is NOT present in
the data sent by the browser then no value (undefined) is returned from the method.
|
Remarks Searches for a named HTTP header and returns the contents of the header (if present) to the Pattern Page. If there are multiple HTTP headers with the same name, this method can only return the first. If access
to such headers is required then the Pattern Page should make use of
'rb.page.iterateHeader' to step
through each header in turn. Example
var cookieHeader = rb.page.getHeader("Cookie");
if (cookieHeader) {
rb.page.write("<p>Cookie Header Contains---:"+cookieHeader);
else
rb.page.write("<p>No Cookie Header Found!");
|
|
(loadtime : 108ms) |