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

writeheader()

Add a specific HTTP header to the outgoing HTTP document.

Syntax

void = rb.page.writeheader(HeaderName, HeaderContents)

Parameters

The 'writeheader' method takes 2 parameters:

Name Type/Value Range/Length Description
HeaderNamestring  Required. Name of the HTTP header to write.
HeaderContentsstring  Required. Data associated with this HTTP header.

Results

The 'writeheader' method returns no useful information.

Remarks

This method allows a web author to write a specific HTTP header to the page being sent to the remote browser. In the Whitebeam system it is highly unusual to need to send a specific header to the client.

The method takes two parameters - the first is the name of the header to send and the second is the data to be contained in that header. Note that in general no data is actually sent to the browser until the entire contents of the page have been generated. This method therefore effectively adds the header to a queue of headers waiting to be sent to the browser.

If it is necessary to send the headers before the entire page is generated then use the rb.page.sendHTTPheaders() method.

If your page wants to manually write HTTP headers using this method and that page also uses rb.page.sendHTTPheaders() then you must call this method before calling rb.page.sendHTTPheaders().

Example

The following example manually writes a cookie header to the browser. The body of the cookie includes the data 'NAME=date=14th'.

<rb:script>
   rb.page.writeheader("Set-Cookie", "NAME=date=14th;");
</rb:script>
Whitebeam release 1.3.36
(loadtime : 126ms)