diff options
Diffstat (limited to 'lib/base/cgi.html')
-rw-r--r-- | lib/base/cgi.html | 486 |
1 files changed, 486 insertions, 0 deletions
diff --git a/lib/base/cgi.html b/lib/base/cgi.html new file mode 100644 index 000000000..dded002bc --- /dev/null +++ b/lib/base/cgi.html @@ -0,0 +1,486 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<!-- This file is generated by Nimrod. --> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Module cgi</title> +<style type="text/css"> + +span.DecNumber {color: blue} +span.BinNumber {color: blue} +span.HexNumber {color: blue} +span.OctNumber {color: blue} +span.FloatNumber {color: blue} +span.Identifier {color: black} +span.Keyword {font-weight: bold} +span.StringLit {color: blue} +span.LongStringLit {color: blue} +span.CharLit {color: blue} +span.EscapeSequence {color: black} +span.Operator {color: black} +span.Punctation {color: black} +span.Comment, span.LongComment {font-style:italic; color: green} +span.RegularExpression {color: pink} +span.TagStart {color: yellow} +span.TagEnd {color: yellow} +span.Key {color: blue} +span.Value {color: black} +span.RawData {color: blue} +span.Assembler {color: blue} +span.Preprocessor {color: yellow} +span.Directive {color: yellow} +span.Command, span.Rule, span.Hyperlink, span.Label, span.Reference, +span.Other {color: black} + +div.navigation { + float: left; + width: 27%; //25em; + margin: 0; padding: 0; /* + border: 1px dashed gold; */ + outline: 3px outset #7F7F7F; //#99ff99; //gold; + background-color: #7F7F7F; +} + +div.navigation ul {list-style-type: none;} +div.navigation ul li a, div.navigation ul li a:visited { + font-weight: bold; + color: #FFFFFF; // #CC0000; + text-decoration: none; +} +div.navigation ul li a:hover { + font-weight: bold; + text-decoration: none; + /*outline: 2px outset #7F7F7F;*/ + color: gold; + /* background-color: #FFFFFF; // #1A1A1A; // #779977;*/ +} + +div.content { + margin-left: 27%; // 25em; + padding: 0 1em; + /*border: 1px dashed #1A1A1A;*/ + min-width: 16em; +} + +dl.item dd, dl.item dd p { + margin-top:3px; +} +dl.item dd pre { + margin-left: 15pt; + border: 0px; +} +dl.item dt, dl.item dt pre { + margin: 20pt 0 0 0; +} + +pre, span.tok { + background-color:#F9F9F9; + border:1px dotted #2F6FAB; + color:black; +} + +/* +:Author: David Goodger +:Contact: goodger@python.org +:Date: Date: 2006-05-21 22:44:42 +0200 (Sun, 21 May 2006) +:Revision: Revision: 4564 +:Copyright: This stylesheet has been placed in the public domain. + +Default cascading style sheet for the HTML output of Docutils. + +See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to +customize this style sheet. +*/ +/* used to remove borders from tables and images */ +.borderless, table.borderless td, table.borderless th { border: 0 } + +table.borderless td, table.borderless th { + /* Override padding for "table.docutils td" with "! important". + The right padding separates the table cells. */ + padding: 0 0.5em 0 0 ! important } + +.first { margin-top: 0 ! important } +.last, .with-subtitle { margin-bottom: 0 ! important } +.hidden { display: none } +a.toc-backref { text-decoration: none ; color: black } +blockquote.epigraph { margin: 2em 5em ; } +dl.docutils dd { margin-bottom: 0.5em } +div.abstract { margin: 2em 5em } +div.abstract p.topic-title { font-weight: bold ; text-align: center } +div.admonition, div.attention, div.caution, div.danger, div.error, +div.hint, div.important, div.note, div.tip, div.warning { + margin: 2em ; border: medium outset ; padding: 1em } +div.admonition p.admonition-title, div.hint p.admonition-title, +div.important p.admonition-title, div.note p.admonition-title, +div.tip p.admonition-title { font-weight: bold ; font-family: sans-serif } + +div.attention p.admonition-title, div.caution p.admonition-title, +div.danger p.admonition-title, div.error p.admonition-title, +div.warning p.admonition-title { color: red ; font-weight: bold ; + font-family: sans-serif } + +/* Uncomment (and remove this text!) to get reduced vertical space in + compound paragraphs. +div.compound .compound-first, div.compound .compound-middle { + margin-bottom: 0.5em } + +div.compound .compound-last, div.compound .compound-middle { + margin-top: 0.5em } +*/ + +div.dedication { margin: 2em 5em ; text-align: center ; font-style: italic } +div.dedication p.topic-title { font-weight: bold ; font-style: normal } +div.figure { margin-left: 2em ; margin-right: 2em } +div.footer, div.header { clear: both; font-size: smaller } +div.line-block { display: block ; margin-top: 1em ; margin-bottom: 1em } +div.line-block div.line-block { margin-top: 0 ; margin-bottom: 0 ; + margin-left: 1.5em } +div.sidebar { margin-left: 1em ; border: medium outset ; + padding: 1em ; background-color: #ffffee ; width: 40% ; float: right ; + clear: right } + +div.sidebar p.rubric { font-family: sans-serif ; font-size: medium } +div.system-messages { margin: 5em } +div.system-messages h1 { color: red } +div.system-message { border: medium outset ; padding: 1em } +div.system-message p.system-message-title { color: red ; font-weight: bold } +div.topic { margin: 2em;} +h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, +h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { + margin-top: 0.4em } +h1.title { text-align: center } +h2.subtitle { text-align: center } +hr.docutils { width: 75% } +img.align-left { clear: left } +img.align-right { clear: right } +ol.simple, ul.simple { margin-bottom: 1em } +ol.arabic { list-style: decimal } +ol.loweralpha { list-style: lower-alpha } +ol.upperalpha { list-style: upper-alpha } +ol.lowerroman { list-style: lower-roman } +ol.upperroman { list-style: upper-roman } +p.attribution { text-align: right ; margin-left: 50% } +p.caption { font-style: italic } +p.credits { font-style: italic ; font-size: smaller } +p.label { white-space: nowrap } +p.rubric { font-weight:bold;font-size:larger;color:maroon;text-align:center} +p.sidebar-title {font-family: sans-serif ;font-weight: bold ;font-size: larger } +p.sidebar-subtitle {font-family: sans-serif ; font-weight: bold } +p.topic-title { font-weight: bold } +pre.address { margin-bottom: 0;margin-top:0;font-family:serif;font-size:100% } +pre.literal-block, pre.doctest-block {margin-left: 2em ;margin-right: 2em } +span.classifier {font-family: sans-serif;font-style: oblique } +span.classifier-delimiter {font-family: sans-serif;font-weight: bold } +span.interpreted {font-family: sans-serif } +span.option {white-space: nowrap } +span.pre {white-space: pre } +span.problematic {color: red } +span.section-subtitle { + /* font-size relative to parent (h1..h6 element) */ + font-size: 80% } + +table.citation { border-left: solid 1px gray; margin-left: 1px } +table.docinfo {margin: 2em 4em } +table.docutils {margin-top: 0.5em;margin-bottom: 0.5em } +table.footnote {border-left: solid 1px black;margin-left: 1px } + +table.docutils td, table.docutils th, +table.docinfo td, table.docinfo th {padding-left: 0.5em;padding-right: 0.5em; + vertical-align: top} + +table.docutils th.field-name, table.docinfo th.docinfo-name { + font-weight: bold;text-align: left;white-space: nowrap;padding-left: 0 } +h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, +h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {font-size: 100% } +ul.auto-toc { list-style-type: none } +/*a.reference { color: #E00000; font-weight:bold;} +a.reference:hover {color: #E00000;background-color: #ffff00;display: margin; + font-weight:bold;}*/ + +</style> +<script type="text/javascript"> + //<![CDATA[ + function toggleElem(id) { + var e = document.getElementById(id); + e.style.display = e.style.display == 'none' ? 'block' : 'none'; + } + + var gOpen = 'none' + function toggleAll() { + gOpen = gOpen == 'none' ? 'block' : 'none'; + var i = 1 + while (1) { + var e = document.getElementById("m"+i) + if (!e) break; + e.style.display = gOpen + i++; + } + document.getElementById('toggleButton').value = + gOpen == 'none' ? 'Show Details' : 'Hide Details'; + } + //]]> +</script> + +</head> +<body> +<div class="document" id="documentId"> +<h1 class="title">Module cgi</h1> +<div class="navigation"> +<p class="topic-title first">Navigation</p> +<ul class="simple"> +<li> + <a class="reference" href="#6" id="56">Types</a> + <ul class="simple"> + <li><a class="reference" href="#103">ECgi</a></li> + <li><a class="reference" href="#104">TRequestMethod</a></li> + + </ul> +</li> +<li> + <a class="reference" href="#9" id="59">Procs</a> + <ul class="simple"> + <li><a class="reference" href="#101">URLencode</a></li> + <li><a class="reference" href="#102">URLdecode</a></li> + <li><a class="reference" href="#105">readData</a></li> + <li><a class="reference" href="#106">validateData</a></li> + <li><a class="reference" href="#107">getContentLength</a></li> + <li><a class="reference" href="#108">getContentType</a></li> + <li><a class="reference" href="#109">getDocumentRoot</a></li> + <li><a class="reference" href="#110">getGatewayInterface</a></li> + <li><a class="reference" href="#111">getHttpAccept</a></li> + <li><a class="reference" href="#112">getHttpAcceptCharset</a></li> + <li><a class="reference" href="#113">getHttpAccept Encoding</a></li> + <li><a class="reference" href="#114">getHttpAccept Language</a></li> + <li><a class="reference" href="#115">getHttpConnection</a></li> + <li><a class="reference" href="#116">getHttpCookie</a></li> + <li><a class="reference" href="#117">getHttpHost</a></li> + <li><a class="reference" href="#118">getHttpReferer</a></li> + <li><a class="reference" href="#119">getHttpUserAgent</a></li> + <li><a class="reference" href="#120">getPathInfo</a></li> + <li><a class="reference" href="#121">getPathTranslated</a></li> + <li><a class="reference" href="#122">getQueryString</a></li> + <li><a class="reference" href="#123">getRemoteAddr</a></li> + <li><a class="reference" href="#124">getRemoteHost</a></li> + <li><a class="reference" href="#125">getRemoteIdent</a></li> + <li><a class="reference" href="#126">getRemotePort</a></li> + <li><a class="reference" href="#127">getRemoteUser</a></li> + <li><a class="reference" href="#128">getRequestMethod</a></li> + <li><a class="reference" href="#129">getRequestURI</a></li> + <li><a class="reference" href="#130">getScriptFilename</a></li> + <li><a class="reference" href="#131">getScriptName</a></li> + <li><a class="reference" href="#132">getServerAddr</a></li> + <li><a class="reference" href="#133">getServerAdmin</a></li> + <li><a class="reference" href="#134">getServerName</a></li> + <li><a class="reference" href="#135">getServerPort</a></li> + <li><a class="reference" href="#136">getServerProtocol</a></li> + <li><a class="reference" href="#137">getServerSignature</a></li> + <li><a class="reference" href="#138">getServerSoftware</a></li> + <li><a class="reference" href="#139">setTestData</a></li> + <li><a class="reference" href="#140">writeContentType</a></li> + + </ul> +</li> + +</ul> +</div> +<div class="content"> +This module implements helper procs for CGI applictions. Example:<pre> +<span class="Keyword">import</span> <span class="Identifier">strtabs</span><span class="Punctation">,</span> <span class="Identifier">cgi</span> + +<span class="Comment"># Fill the values when debugging:</span> +<span class="Keyword">when</span> <span class="Identifier">debug</span><span class="Punctation">:</span> + <span class="Identifier">setTestData</span><span class="Punctation">(</span><span class="StringLit">"name"</span><span class="Punctation">,</span> <span class="StringLit">"Klaus"</span><span class="Punctation">,</span> <span class="StringLit">"password"</span><span class="Punctation">,</span> <span class="StringLit">"123456"</span><span class="Punctation">)</span> +<span class="Comment"># read the data into `myData`</span> +<span class="Keyword">var</span> <span class="Identifier">myData</span> <span class="Operator">=</span> <span class="Identifier">readData</span><span class="Punctation">(</span><span class="Punctation">)</span> +<span class="Comment"># check that the data's variable names are "name" or "passwort"</span> +<span class="Identifier">validateData</span><span class="Punctation">(</span><span class="Identifier">myData</span><span class="Punctation">,</span> <span class="StringLit">"name"</span><span class="Punctation">,</span> <span class="StringLit">"password"</span><span class="Punctation">)</span> +<span class="Comment"># start generating content:</span> +<span class="Identifier">writeContentType</span><span class="Punctation">(</span><span class="Punctation">)</span> +<span class="Comment"># generate content:</span> +<span class="Identifier">write</span><span class="Punctation">(</span><span class="Identifier">stdout</span><span class="Punctation">,</span> <span class="StringLit">"<!DOCTYPE HTML PUBLIC </span><span class="EscapeSequence">\"</span>-//W3C//DTD HTML 4.01//EN<span class="EscapeSequence">\"</span><span class="EscapeSequence">>\n</span><span class="StringLit">"</span><span class="Punctation">)</span> +<span class="Identifier">write</span><span class="Punctation">(</span><span class="Identifier">stdout</span><span class="Punctation">,</span> <span class="StringLit">"<html><head><title>Test</title></head><body></span><span class="EscapeSequence">\n</span><span class="StringLit">"</span><span class="Punctation">)</span> +<span class="Identifier">writeln</span><span class="Punctation">(</span><span class="Identifier">stdout</span><span class="Punctation">,</span> <span class="StringLit">"your name: "</span> <span class="Operator">&</span> <span class="Identifier">myData</span><span class="Punctation">[</span><span class="StringLit">"name"</span><span class="Punctation">]</span><span class="Punctation">)</span> +<span class="Identifier">writeln</span><span class="Punctation">(</span><span class="Identifier">stdout</span><span class="Punctation">,</span> <span class="StringLit">"your password: "</span> <span class="Operator">&</span> <span class="Identifier">myData</span><span class="Punctation">[</span><span class="StringLit">"password"</span><span class="Punctation">]</span><span class="Punctation">)</span> +<span class="Identifier">writeln</span><span class="Punctation">(</span><span class="Identifier">stdout</span><span class="Punctation">,</span> <span class="StringLit">"</body></html>"</span><span class="Punctation">)</span></pre> +<div class="section" id="6"> +<h1><a class="toc-backref" href="#56">Types</a></h1> +<dl class="item"> +<dt id="103"><pre><span class="Identifier">ECgi</span><span class="Operator">*</span> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <span class="Identifier">EIO</span></pre></dt> +<dd> +the exception that is raised, if a CGI error occurs +</dd> +<dt id="104"><pre><span class="Identifier">TRequestMethod</span><span class="Operator">*</span> <span class="Other">=</span> <span class="Keyword">enum</span> + <span class="Identifier">methodPost</span><span class="Other">,</span> <span class="Comment">## query uses the POST method</span> + <span class="Identifier">methodGet</span> <span class="Comment">## query uses the GET method</span></pre></dt> +<dd> +the used request method +</dd> + +</dl></div> +<div class="section" id="9"> +<h1><a class="toc-backref" href="#59">Procs</a></h1> +<dl class="item"> +<dt id="101"><pre><span class="Keyword">proc</span> <span class="Identifier">URLencode</span><span class="Operator">*</span><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +Encodes a value to be HTTP safe: This means that characters in the set <tt class="docutils literal"><span class="pre">{'A'..'Z', 'a'..'z', '0'..'9', '_'}</span></tt> are carried over to the result, a space is converted to <tt class="docutils literal"><span class="pre">'+'</span></tt> and every other character is encoded as <tt class="docutils literal"><span class="pre">'%xx'</span></tt> where <tt class="docutils literal"><span class="pre">xx</span></tt> denotes its hexadecimal value. +</dd> +<dt id="102"><pre><span class="Keyword">proc</span> <span class="Identifier">URLdecode</span><span class="Operator">*</span><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +Decodes a value from its HTTP representation: This means that a <tt class="docutils literal"><span class="pre">'+'</span></tt> is converted to a space, <tt class="docutils literal"><span class="pre">'%xx'</span></tt> (where <tt class="docutils literal"><span class="pre">xx</span></tt> denotes a hexadecimal value) is converted to the character with ordinal number <tt class="docutils literal"><span class="pre">xx</span></tt>, and and every other character is carried over. +</dd> +<dt id="105"><pre><span class="Keyword">proc</span> <span class="Identifier">readData</span><span class="Operator">*</span><span class="Other">(</span><span class="Identifier">allowedMethods</span><span class="Other">:</span> <span class="Identifier">set</span><span class="Other">[</span><span class="Identifier">TRequestMethod</span><span class="Other">]</span> <span class="Other">=</span> <span class="Other">{</span><span class="Identifier">methodPost</span><span class="Other">,</span> <span class="Identifier">methodGet</span><span class="Other">}</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">PStringTable</span></pre></dt> +<dd> +Read CGI data. If the client does not use a method listed in the <cite>allowedMethods</cite> set, an <cite>ECgi</cite> exception is raised. +</dd> +<dt id="106"><pre><span class="Keyword">proc</span> <span class="Identifier">validateData</span><span class="Operator">*</span><span class="Other">(</span><span class="Identifier">data</span><span class="Other">:</span> <span class="Identifier">PStringTable</span><span class="Other">,</span> <span class="Identifier">validKeys</span><span class="Other">:</span> <span class="Identifier">openarray</span><span class="Other">[</span><span class="Identifier">string</span><span class="Other">]</span><span class="Other">)</span></pre></dt> +<dd> +validates data; raises <cite>ECgi</cite> if this fails. This checks that each variable name of the CGI <cite>data</cite> occurs in the <cite>validKeys</cite> array. +</dd> +<dt id="107"><pre><span class="Keyword">proc</span> <span class="Identifier">getContentLength</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">CONTENT_LENGTH</span></tt> environment variable +</dd> +<dt id="108"><pre><span class="Keyword">proc</span> <span class="Identifier">getContentType</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">CONTENT_TYPE</span></tt> environment variable +</dd> +<dt id="109"><pre><span class="Keyword">proc</span> <span class="Identifier">getDocumentRoot</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">DOCUMENT_ROOT</span></tt> environment variable +</dd> +<dt id="110"><pre><span class="Keyword">proc</span> <span class="Identifier">getGatewayInterface</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">GATEWAY_INTERFACE</span></tt> environment variable +</dd> +<dt id="111"><pre><span class="Keyword">proc</span> <span class="Identifier">getHttpAccept</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">HTTP_ACCEPT</span></tt> environment variable +</dd> +<dt id="112"><pre><span class="Keyword">proc</span> <span class="Identifier">getHttpAcceptCharset</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">HTTP_ACCEPT_CHARSET</span></tt> environment variable +</dd> +<dt id="113"><pre><span class="Keyword">proc</span> <span class="Identifier">getHttpAcceptEncoding</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">HTTP_ACCEPT_ENCODING</span></tt> environment variable +</dd> +<dt id="114"><pre><span class="Keyword">proc</span> <span class="Identifier">getHttpAcceptLanguage</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">HTTP_ACCEPT_LANGUAGE</span></tt> environment variable +</dd> +<dt id="115"><pre><span class="Keyword">proc</span> <span class="Identifier">getHttpConnection</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">HTTP_CONNECTION</span></tt> environment variable +</dd> +<dt id="116"><pre><span class="Keyword">proc</span> <span class="Identifier">getHttpCookie</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">HTTP_COOKIE</span></tt> environment variable +</dd> +<dt id="117"><pre><span class="Keyword">proc</span> <span class="Identifier">getHttpHost</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">HTTP_HOST</span></tt> environment variable +</dd> +<dt id="118"><pre><span class="Keyword">proc</span> <span class="Identifier">getHttpReferer</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">HTTP_REFERER</span></tt> environment variable +</dd> +<dt id="119"><pre><span class="Keyword">proc</span> <span class="Identifier">getHttpUserAgent</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">HTTP_USER_AGENT</span></tt> environment variable +</dd> +<dt id="120"><pre><span class="Keyword">proc</span> <span class="Identifier">getPathInfo</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">PATH_INFO</span></tt> environment variable +</dd> +<dt id="121"><pre><span class="Keyword">proc</span> <span class="Identifier">getPathTranslated</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">PATH_TRANSLATED</span></tt> environment variable +</dd> +<dt id="122"><pre><span class="Keyword">proc</span> <span class="Identifier">getQueryString</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">QUERY_STRING</span></tt> environment variable +</dd> +<dt id="123"><pre><span class="Keyword">proc</span> <span class="Identifier">getRemoteAddr</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">REMOTE_ADDR</span></tt> environment variable +</dd> +<dt id="124"><pre><span class="Keyword">proc</span> <span class="Identifier">getRemoteHost</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">REMOTE_HOST</span></tt> environment variable +</dd> +<dt id="125"><pre><span class="Keyword">proc</span> <span class="Identifier">getRemoteIdent</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">REMOTE_IDENT</span></tt> environment variable +</dd> +<dt id="126"><pre><span class="Keyword">proc</span> <span class="Identifier">getRemotePort</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">REMOTE_PORT</span></tt> environment variable +</dd> +<dt id="127"><pre><span class="Keyword">proc</span> <span class="Identifier">getRemoteUser</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">REMOTE_USER</span></tt> environment variable +</dd> +<dt id="128"><pre><span class="Keyword">proc</span> <span class="Identifier">getRequestMethod</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">REQUEST_METHOD</span></tt> environment variable +</dd> +<dt id="129"><pre><span class="Keyword">proc</span> <span class="Identifier">getRequestURI</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">REQUEST_URI</span></tt> environment variable +</dd> +<dt id="130"><pre><span class="Keyword">proc</span> <span class="Identifier">getScriptFilename</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">SCRIPT_FILENAME</span></tt> environment variable +</dd> +<dt id="131"><pre><span class="Keyword">proc</span> <span class="Identifier">getScriptName</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">SCRIPT_NAME</span></tt> environment variable +</dd> +<dt id="132"><pre><span class="Keyword">proc</span> <span class="Identifier">getServerAddr</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">SERVER_ADDR</span></tt> environment variable +</dd> +<dt id="133"><pre><span class="Keyword">proc</span> <span class="Identifier">getServerAdmin</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">SERVER_ADMIN</span></tt> environment variable +</dd> +<dt id="134"><pre><span class="Keyword">proc</span> <span class="Identifier">getServerName</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">SERVER_NAME</span></tt> environment variable +</dd> +<dt id="135"><pre><span class="Keyword">proc</span> <span class="Identifier">getServerPort</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">SERVER_PORT</span></tt> environment variable +</dd> +<dt id="136"><pre><span class="Keyword">proc</span> <span class="Identifier">getServerProtocol</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">SERVER_PROTOCOL</span></tt> environment variable +</dd> +<dt id="137"><pre><span class="Keyword">proc</span> <span class="Identifier">getServerSignature</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">SERVER_SIGNATURE</span></tt> environment variable +</dd> +<dt id="138"><pre><span class="Keyword">proc</span> <span class="Identifier">getServerSoftware</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt> +<dd> +returns contents of the <tt class="docutils literal"><span class="pre">SERVER_SOFTWARE</span></tt> environment variable +</dd> +<dt id="139"><pre><span class="Keyword">proc</span> <span class="Identifier">setTestData</span><span class="Operator">*</span><span class="Other">(</span><span class="Identifier">keysvalues</span><span class="Other">:</span> <span class="Identifier">openarray</span><span class="Other">[</span><span class="Identifier">string</span><span class="Other">]</span><span class="Other">)</span></pre></dt> +<dd> +fills the appropriate environment variables to test your CGI application. This can only simulate the 'GET' 'REQUEST_METHOD'. <cite>keysvalues</cite> should provide embedded (name, value)-pairs. Example:<pre><span class="Identifier">setTestData</span><span class="Punctation">(</span><span class="StringLit">"name"</span><span class="Punctation">,</span> <span class="StringLit">"Hanz"</span><span class="Punctation">,</span> <span class="StringLit">"password"</span><span class="Punctation">,</span> <span class="StringLit">"12345"</span><span class="Punctation">)</span></pre> +</dd> +<dt id="140"><pre><span class="Keyword">proc</span> <span class="Identifier">writeContentType</span><span class="Operator">*</span><span class="Other">(</span><span class="Other">)</span></pre></dt> +<dd> +call this before starting to send your HTML data to <cite>stdout</cite>. This is just a shorthand for: .. code-block:: Nimrod<blockquote>write(stdout, "Content-type: text/htmlnn")</blockquote> + +</dd> + +</dl></div> + +</div> + +<small>Generated: 2008-12-08 20:29:49 UTC</small> +</div> +</body> +</html> |