1HTMLDocument.addHTTPHeader(3kaKyaay)a module referHeTnMcLeDocument.addHTTPHeader(3kaya)
2
3
4
6 HTMLDocument::addHTTPHeader - Adds a HTTP header to the document
7
9 Void addHTTPHeader( HTMLDocument doc, String name, String value )
10
12 doc The HTML document
13
14 name The name of the header
15
16 value The contents of the header
17
19 Adds a HTTP header to the document. If the document is then printed
20 using Webapp.displayPage (3kaya) , these headers will be sent to the
21 client.
22
23 The effects of multiple HTTP headers with the same name vary. Some
24 headers may be rewritten by the web server if they appear multiple
25 times.
26
27 You can change the HTTP status code using the special Status header.
28 The default is 200, of course - due to a bug in older versions of
29 Apache, explicitly setting a 200 status is not recommended. Headers
30 with names beginning "X-" are non-standard and could mean anything.
31
32
33 addHTTPHeader(doc,"Last-Modified",rfc2822Time(lmstamp));
34 addHTTPHeader(doc,"Status","404 File not found");
35 addHTTPHeader(doc,"X-Generator","Kaya");
36
37 The characters allowed in HTTP headers are relatively restricted, espe‐
38 cially in the name field, the most obvious restriction being that they
39 may not contain new lines. Webapp.displayPage (3kaya) will throw an
40 Exception if illegal characters are found - be sure to check this if
41 you write your own header output function.
42
43 RFC 2616 ⟨http://www.w3.org/Protocols/rfc2616/⟩ describes the HTTP pro‐
44 tocol including HTTP headers in detail
45
46 You may set multiple headers with the same name, but this may not be
47 sensible for some headers (for example, multiple Status headers make no
48 sense, whereas multiple Set-Cookie headers are commonly used).
49
51 Kaya standard library by Edwin Brady, Chris Morris and others
52 (kaya@kayalang.org). For further information see http://kayalang.org/
53
55 The Kaya standard library is free software; you can redistribute it
56 and/or modify it under the terms of the GNU Lesser General Public
57 License (version 2.1 or any later version) as published by the Free
58 Software Foundation.
59
61 HTMLDocument.HTMLDocument (3kaya)
62 HTMLDocument.addHTTPHeader (3kaya)
63 Webapp.displayPage (3kaya)
64
65
66
67Kaya December 2010HTMLDocument.addHTTPHeader(3kaya)