function CGI:log()
string CGI:name()
string CGI:path()
function CGI:print()
Request CGI:request()
Response CGI:response()
self CGI:run( table someMappings )
string CGI:version()
string CGI:request():address()
Returns the IP address of the client that sent the request. Same as the value of the CGI variable REMOTE_ADDR.
string CGI:request():authentication()
Returns the name of the authentication scheme. Same as the value of the CGI variable AUTH_TYPE.
number CGI:request():contentLength()
Returns the length of the request content. Same as the value of the CGI variable CONTENT_LENGTH.
string CGI:request():contentType()
Returns the MIME type of the request. Same as the value of the CGI variable CONTENT_TYPE.
string CGI:request():cookie( string aKey )
table CGI:request():cookies()
string CGI:request():header( string aKey )
Returns the value of the specified request header as a string. If the request did not include a header of the specified name, this method returns nil. The header name is case insensitive.
string CGI:request():method()
Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT. Same as the value of the CGI variable REQUEST_METHOD.
string CGI:request():parameter( string aKey )
Returns the value of a request parameter as a string, or nil if the parameter does not exist. For HTTP, parameters are contained in the query string or posted form data.
table CGI:request():parameters()
URL CGI:request():url()
string CGI:request():user()
Returns the login of the user making this request. Same as the value of the CGI variable REMOTE_USER.
string CGI:request():version()
Returns the name and version of the protocol the request uses, for example, HTTP/1.1. Same as the value of the CGI variable SERVER_PROTOCOL.
string CGI:request():url():decode()
table CGI:request():url():decodeParameters()
string CGI:request():url():encode()
string CGI:request():url():encodeParameters()
string CGI:request():url():host()
Returns the host name of the server that received the request. Same as the value of the CGI variable SERVER_NAME.
string CGI:request():url():path()
Returns the path of this request's URL. Same as the value of the CGI variable PATH_INFO.
number CGI:request():url():port()
Returns the port number on which this request was received. Same as the value of the CGI variable SERVER_PORT.
table CGI:request():url():queries()
string CGI:request():url():query()
Returns the query string that is contained in the request URL after the path. Same as the value of the CGI variable QUERY_STRING.
string CGI:request():url():scheme()
Returns the name of the scheme used to make this request, for example, http, https, or ftp.
string CGI:response():contentType()
self CGI:response():setContentType()
string CGI:response():cookie( string aKey )
self CGI:response():setCookie( string aKey, any aValue [, table someOptions ] )
table CGI:response():cookies()
string CGI:response():encoding()
Returns the name of the character encoding used in the body of this response. Defaults to UTF-8.
string CGI:response():header( string aKey )
self CGI:response():setHeader( string aKey, any aValue )
table CGI:response():headers()
string CGI:response():server()
number, string CGI:response():status()
self CGI:response():setStatus( number aValue, string aDescription )
self CGI:response():write( string ... )
Copyright © 2006 Raphaël Szwarc
This software is provided 'as-is', without any express or implied warranty. In no event will the author be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.