Version 0.1
A very serious, industrial web framework in Tcl
 All Data Structures Namespaces Files Functions Variables Pages
Public Member Functions | Static Public Attributes
tanzer::message Class Reference
Inheritance diagram for tanzer::message:
tanzer::request tanzer::response tanzer::http::request tanzer::scgi::request tanzer::file::listing

Public Member Functions

 constructor args
 
 ready
 
 incomplete
 
 parse varName
 
 version args
 
 header name args
 
 headers ?newHeaders?
 
 headerExists name
 
 encodingAccepted encoding
 
 chunked
 
 buffer data
 
 body
 
 length
 
 keepalive
 
 send sock
 

Static Public Attributes

 maxLength
 
 defaultVersion
 

Constructor & Destructor Documentation

tanzer::message::constructor   args  

Create a new HTTP message. All arguments in $args are passed to the method ::tanzer::message::setup verbatim.

Member Function Documentation

tanzer::message::body

Return any body data buffered for the current message.

tanzer::message::buffer   data  

Append the bytes in $data to the current message body.

tanzer::message::chunked

Returns true if the current message is presumed to use a chunked transfer encoded body, as indicated by the presence of a Transfer-Encoding: header with a value of Chunked (case insensitive). Otherwise, returns false.

tanzer::message::encodingAccepted   encoding  

Returns true if an Accept-Encoding: header is defined in the current message, and the value $encoding is one of the lsited accepted encodings specified in the message. Otherwise, returns false.

tanzer::message::header   name args  

Get or set the value of a message header. If only $name is specified, then return the value of the header. If a second argument is specified, then set or replace the current value of $name its value.

tanzer::message::headerExists   name  

Returns true if the header $name exists in the current message.

tanzer::message::headers   ?newHeaders?  

Get or set all headers associated with the current message. If a list of key-value pairs is specified in $newHeaders, then set each of the headers contained therein using tanzer::message::header. Otherwise, return the dictionary of headers for the current message.

tanzer::message::incomplete

Treturns true if the current request or response object has not yet been fully parsed by tanzer::message::parse.

tanzer::message::keepalive

Returns true if there is a Connection: header specifying a keep-alive (case insensitive) value present in the current message. Or, if there is no Content-Length: header specified for the current message, then return false regardless. In any other case, return false.

tanzer::message::length

Returns the length of the current message body. If a message body was buffered using tanzer::message::buffer, then the total length of the message body buffered is returned. Otherwise, if a Content-Length: header value is present, return that. If neither of these conditions are true, then return zero to indicate an empty message body.

tanzer::message::parse   varName  

Parse the HTTP message present in a buffer named $varName in the calling context. All headers, request or response data will be parsed and set as appropriate in the current message object.

tanzer::message::ready

Returns true if the current request or response object has been successfully parsed by tanzer::message::parse.

tanzer::message::send   sock  

Encode and send the current message, headers, body and request or response preamble, to the remote end specified by $sock.

tanzer::message::version   args  

Return the current message HTTP version string, or, if one was not parsed, use the default assumed in tanzer::message::defaultVersion.

Field Documentation

tanzer::message::defaultVersion
static

The default HTTP protocol version assumed is HTTP/1.1.

tanzer::message::maxLength
static

The maximum length of any HTTP message, including request or response preamble, and headers, is 1MB.


The documentation for this class was generated from the following file: