Provided by: kaya_0.4.4-6ubuntu3_amd64
NAME
HTMLDocument::addHTTPHeader - Adds a HTTP header to the document
SYNOPSIS
Void addHTTPHeader( HTMLDocument doc, Pair<String, String> header )
ARGUMENTS
doc The HTML document header A pair of Strings describing the header
DESCRIPTION
Adds a HTTP header to the document. If the document is then printed using Webapp.displayPage (3kaya) , these headers will be sent to the client. The effects of multiple HTTP headers with the same name vary. Some headers may be rewritten by the web server if they appear multiple times. You can change the HTTP status code using the special Status header. The default is 200, of course - due to a bug in older versions of Apache, explicitly setting a 200 status is not recommended. Headers with names beginning "X-" are non-standard and could mean anything. addHTTPHeader(doc,setCookie("session",getSessionId())); The characters allowed in HTTP headers are relatively restricted, especially in the name field, the most obvious restriction being that they may not contain new lines. Webapp.displayPage (3kaya) will throw an Exception if illegal characters are found - be sure to check this if you write your own header output function. RFC 2616 ⟨http://www.w3.org/Protocols/rfc2616/⟩ describes the HTTP protocol including HTTP headers in detail You may set multiple headers with the same name, but this may not be sensible for some headers (for example, multiple Status headers make no sense, whereas multiple Set-Cookie headers are commonly used).
AUTHORS
Kaya standard library by Edwin Brady, Chris Morris and others (kaya@kayalang.org). For further information see http://kayalang.org/
LICENSE
The Kaya standard library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (version 2.1 or any later version) as published by the Free Software Foundation.
RELATED
HTMLDocument.HTMLDocument (3kaya) HTMLDocument.addHTTPHeader_1 (3kaya) Webapp.displayPage (3kaya) WebCommon.setCookie (3kaya)