GLOBAL INDEX  |  FRAMES  |  NO FRAMES
Library: request
Overview
Helpers for reading data from the HTTP request.
source: request.js
Functions
request.toHTML()
Enables pretty-printing of request object for debugging.
returns
string html-formatted string.
Objects
object
request
Note: you can call print(request) to see a nice display for debugging.
string
request.path
The request path following the hostname. For example, if the user is visiting yourapp.appjet.net/foo, then this will be set to "/foo". This does not include CGI parameters or the domain name, and always begins with a "/".
string
request.query
The value request query string. For example, if the user visits "yourapp.appjet.net/foo?id=20", then request.query will be "id=20".
string
request.method
Either "GET" or "POST" (uppercase).
boolean
request.isGet
Whether the curent HTTP request is a GET request.
boolean
request.isPost
Whether the current HTTP request is a POST request.
string
request.clientAddr
Holds the IP address of the user making the request.
object
request.params
Parameters associated with the request, either from the query string or from the contents of a POST, e.g. from a form. Parameters are accessible by name as properties of this object. The property value is either a string (typically) or an array of strings (if the parameter occurs multiple times in the request).
object
request.headers
Used to access the HTTP headers of the current request. Properties are header names, and each value is either a string (typically) or an array of strings (if the header occurs multiple times in the request).
examples
print(request.headers["User-Agent"]);
object
request.cookies
Contains a map of name:value of all the cookies sent with the request. All values are strings.
examples
if (request.cookies['SessionID'] == "25") {
  // process session number 25
}
Generated by JsDoc Toolkit 1.3.3 on Thu, 03 Jul 2008 01:27:43 GMT.