web::request
?options
? ?key
? ?value
?
web::request
?key
? ?default
?
Options are: -count, -set,
-lappend, -names,
-unset, -reset and
-channel
web::request is an accessor to request specific information: either CGI related (stand alone
Websh) or Apache related (mod_websh).
- web::request -names
returns a list of all known keys.
- web::request
key
?default
?
returns the value for key. Can be a
list. In case that key does not
exist, return default, if it is
given, or an empty string.
- web::request
-count
key
returns number of items in list for
key; returns 0 if
key does not exist.
- web::request
-set
key
does the same as web::request
key.
- web::request
-set
key
value
?value
?
?...
?
adds the parameter key to the
web::request data. Any existing parameters
with key are overwritten.
- web::request
-lappend
key
value
?value
?
?...
?
append parameters with the same key
to the web::request data. In this case the existing
value is not overwritten.
- web::request
-unset
deletes all parameters from the web::request data.
- web::request
-unset
key
deletes a parameter from the web::request data.
- web::request
-reset
deletes all parameters from the web::request data
(like 'web::request -unset'), removes all static
parameters (like 'web::cmdurlcfg -unset'), all form
variables (like 'web::formvar -unset'), all query
string parameters (like 'web::param -unset'), and all
temporary files created by HTTP form upload.
- web::request
-channel
returns the preset default channel for the current request.
(Note that this is not necessarily the currently selected channel.)
web::param
?option
? ?key
? ?value
? ?...
?
Options are: -count, -set,
-lappend, -names, and
-unset
web::param is an accessor to state information from the
querystring. Suppose the querystring is "lang=EN".
After web::dispatch has parsed the querystring,
web::param lang will
report EN
. Additionaly,
web::param can manage this data and add, append, and delete
parameters as needed.
- web::param -names
returns a list of all known keys.
- web::param
key
?default
?
returns the value for key. Can be a
list. In case that key does not
exist, return default, if it is
given, or an empty string.
- web::param
-count
key
returns number of items in list of
key.
- web::param -set
key
does the same as 'web::param
key'.
- web::param -set
key
value
?value
?
?...
?
add the parameter key to the
web::param data. Any existing parameters with
key are overwritten.
- web::param
-lappend
key
value
?value
?
?...
?
append parameters with the same key
to the web::param data. In this case the existing
value is not overwritten.
- web::param -unset
deletes all parameters from the web::param data.
- web::param
-unset
key
delete a parameter from the web::param data.
web::formvar
?options
? ?key
? ?value
?
Exactly like web::param.
web::formvar is an accessor to HTML FORM
data. After web::dispatch has parsed the
POST data, you can access all form fields using
web::formvar.
In addition to this, web::formvar can also
handle files uploaded
via Netscape 2.0 file upload mechanism. In this case, the result of
web::formvar is a list with three elements:
The first element contains the name of the locally saved file;
the second element contains the remote file name; the third element
is set to 0 if the upload was successful, -1 if upload is disabled
(see web::config uploadfilesize) and n > 0 if n
Bytes have been truncated, because the file was too big.
Note that the temporary files are created with the permissions configured by
web::config filepermissions, which defaults to 0644.
Example 6. web::param
% web::request CONTENT_LENGTH
% web::dispatch -querystring "cmd=default&t=100" -postdata "" -cmd ""
% web::param -names
t cmd
% web::param cmd
default
% web::param -set k v
v
% web::param -names
t cmd k
%