## req

    Object
       |
       +--req

SUMMARY: Constructor | Properties | Methods | DETAIL: Constructor | Properties | Methods

Properties Summary
`String` | `action` Contains the name of the requested action The name without the suffix '_action' is provided.
`Object` | `data` Object containing any request parameters (GET, POST, Cookies, etc) and HTTP environmental variables.
`String` | `method` Returns the HTTP method (in uppercase letters) of the current request.
`String` | `password` Returns the decrypted basic authentication password.
`String` | `path` Contains the path of the current request, relative to the application's mountpoint.
`Number` | `runtime` Returns the running time of the current request in milliseconds Provides the amount of time that has elapsed since the start of the processing of the current request, measured in milliseconds (integer).
`String` | `username` Contains the decrypted basic authentication username.

Methods Summary
`void` | `get(<String> name)` An alternative method of accessing properties otherwise made available through the req.data object.
`HttpServletRequest` | `getServletRequest()` Provides access to the HttpServletRequest object Returns an instance of the Java HttpServletRequest Class corresponding to the current request, which allows full access to the methods of that class.
`Boolean` | `isGet()` Returns true if the current request is a HTTP GET request, false otherwise.
`Boolean` | `isPost()` Returns true if the current request is a HTTP POST request, false otherwise.

Properties Detail

### action

    String action

Contains the name of the requested action
The name without the suffix '_action' is provided. This property is read-only.
Example:

     res.write(req.action);
     edit

### data

    Object data

Object containing any request parameters (GET, POST, Cookies, etc) and HTTP environmental variables.
This object contains all passed request parameters as named properties, no matter whether these have been submitted as URL-parameters, as part of a HTTP POST request, or as cookie values.
If more than one value is submitted for one parameter name, the values are stored inside an array called req.data.paramname_array, that is the _array suffix is added to the parameter name. req.data.paramname itself will just contain a single value.
Uploaded files are available in req.data as a MimePart object.
Additionally Helma sets the following HTTP environment variables if they are available:

authorization
  Equivalent to the variable 'authorization' sent in the request header.
http_browser
  Name and version of the client browser. Equivalent to the variable 'User-Agent' sent in the request header.
http_host
  Host name to which that request was sent to. Equivalent to the variable 'Host' sent in the request header.
http_language
  Equivalent to the variable 'Accept-Language' sent in the request header.
http_language
  Equivalent to the variable 'Accept-Language' sent in the request header.
http_remotehost
  IP-Address of the client machine. Equivalent to a getRemoteAddr() call on the servletRequest.
http_referer
  URL of the page the user came from. Equivalent to the variable 'Referer' sent in the request header.

All properties of req.data are read- and write-able.

### method

    String method

Returns the HTTP method (in uppercase letters) of the current request.
Usually 'GET' or 'POST'. For non-web-requests this function will return one of the following: 'XMLRPC', 'EXTERNAL' or 'INTERNAL'.

### password

    String password

Returns the decrypted basic authentication password.
Only for requests that contain user credentials sent with ' basic authentication scheme' method, typically as a result of a previously returned 401 HTTP response.

### path

    String path

Contains the path of the current request, relative to the application's mountpoint.
Starts without a preceding slash. This property is read-only.

### runtime

    Number runtime

Returns the running time of the current request in milliseconds
Provides the amount of time that has elapsed since the start of the processing of the current request, measured in milliseconds (integer).

### username

    String username

Contains the decrypted basic authentication username.
Only for requests that contain user credentials sent with ' basic authentication scheme' method, typically as a result of a previously returned 401 HTTP response.
See also: getPassword

Method Detail

### get

    void get(<String> name)

An alternative method of accessing properties otherwise made available through the req.data object.

Parameters:

`name` - as String, the request data property to read

See:

- data

### getServletRequest

    HttpServletRequest getServletRequest()

Provides access to the HttpServletRequest object
Returns an instance of the Java HttpServletRequest Class corresponding to the current request, which allows full access to the methods of that class.

Returns:

Packages.javax.servlet.http.HttpServletRequest object of the current request

See:

- Packages.javax.servlet.http.HttpServletRequest

### isGet

    Boolean isGet()

Returns true if the current request is a HTTP GET request, false otherwise.

Returns:

Boolean

See:

- isPost()
- method

### isPost

    Boolean isPost()

Returns true if the current request is a HTTP POST request, false otherwise.

Returns:

Boolean

See:

- isGet()
- method

SUMMARY: Constructor | Properties | Methods | DETAIL: Constructor | Properties | Methods

Documentation generated by JSDoc on Thu Apr 5 01:59:00 2007