up: HTTP     index Zimbu documentation

CLASS HTTP.Response @public

summary

     

The HTTP response fields.

int  $code @public  200 (OK), 404 (not found), etc.
string  $msg @public  human readable message related to "code"
dict<string, string>  $headerItems @public  Items to be added to the response header.
string  $body @public  Body of the response, e.g., the HTML page.
 
NEW() @public  Create default header with OK code and HTML type.
$setLength(length) @public  Set header item "Content-Length" to length.
$setType(type) @public  Set header item "Content-Type" to type.
$addCookie(name, value) @public  Add a cookie.
 

members (alphabetically)

     

string $body @public

     

Body of the response, e.g., the HTML page.

TODO: this should be byteString.

int $code @public

     

200 (OK), 404 (not found), etc.

dict<string, string> $headerItems @public

     

Items to be added to the response header.

string $msg @public

     

human readable message related to "code"

Must not contain a line break.

PROC NEW() @public

     

Create default header with OK code and HTML type.

PROC $addCookie(string name, string value) @public

     

Add a cookie.

The value must not contain special characters, such as semi-colon, comma and white space.

PROC $setLength(int length) @public

     

Set header item "Content-Length" to length.

PROC $setType(string type) @public

     

Set header item "Content-Type" to type.

license

      Copyright 2009 Bram Moolenaar All Rights Reserved.

      Licensed under the Apache License, Version 2.0. See the LICENSE file or obtain a copy at: http://www.apache.org/licenses/LICENSE-2.0