HttpRequest
generated from ../src/mod_wxjs/httpreq.cppThe HTTP request. There is only one instance of this class and it's automatically instantiated: 'request'.
Constants
Properties
| Name | Type | Description |
|---|---|---|
URI ![]() |
String | The path portion of the URI |
args ![]() |
String | The QUERY_ARGS extracted from this request |
cookies ![]() |
String array | An array with cookies |
filename ![]() |
String | The name of the requested file |
files ![]() |
Array | Array with UploadFile objects |
get ![]() |
ApacheTable | A table with all get values |
headers ![]() |
ApacheTable | A table with all input headers |
hostname ![]() |
String | The hostname |
method ![]() |
String | Request method (GET, POST, HEAD, ...) |
methodNumber ![]() |
Integer | Request method number(M_GET, M_POST, ...) |
pathInfo ![]() |
String | The PATH_INFO extracted from this request |
post ![]() |
ApacheTable | A table with all posted values |
protocol ![]() |
String | The protocol of the request |
remoteIP ![]() |
String | Client's IP Address |
time ![]() |
Date | Time when the request started |
time ![]() |
Date | Time when the request started |
time ![]() |
Date | Time when the request started |
unparsedURI ![]() |
String | The URI without any parsing performed |
user ![]() |
Object | An object that has the following properties: scheme, hostinfo, user, password, hostname, port, path, query and fragment. |
user ![]() |
String | If an authentication check was made, this gets set to the user name. |
Methods
getCookie
getCookie(Name) : Cookie
| Name | Type | Default | Description |
|---|---|---|---|
| Name | String | The name of the cookie |
Returns a cookie object. The following example shows how to read all cookies.
for(c in request.cookies)
{
cookie = request.getCookie(c);
}
uploadFile
uploadFile(element,
file,
maxLength = -1,
override = false) : boolean
| Name | Type | Default | Description |
|---|---|---|---|
| element | String | The name of the upload element | |
| file | String | The name of the file on the server | |
| maxLength | Integer | -1 | The max. length of the file |
| override | Boolean | false | Override the existing file? |
Use this method to upload a file. When you want to limit the size of the file, use the maxLength argument (-1 means don't check). When the maxLength argument is omitted, there is no check on the contentlength. Make sure mod_wxjs has write permissions! The example shows how to upload all files:
for(f in request.files)
{
request.uploadFile(f, "c:\\temp\\" + request.files[f].filename, -1, true);
}

© 2002 - 2007 Franky Braem.