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 | HeaderName | string | | Required. Name of the HTTP header to write. | HeaderContents | string | | 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.
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>
|