The HTTP request from the client terminal/browser.
All request parameters (URL parameters and FORM parameters)
appear as request's fields. For example, if the query string
contains "a=1&b=2", there will be two fields available in
the request: request.a and request.b
If parameter names contains "keys" enclosed into angle brackets
corresponding array structures are created onto request. For example:
<input type="person[name]" value="john doe">
<input type="person[age]" value="50">
When submitted will yield to attribute person to request
with value
["name"=>"john doe", "age"=>"50"].
Handles also file uploads. For example:
<form method="post" ENCTYPE="multipart/form-data">
<input type="file" name="file1">
</form>
Here the
request.file1 field will contain a
File datatype, which represents an uploaded file.
Methods
Returns the name of the authentication scheme.
Used to protect the "site servlet", for example, "BASIC" or "SSL,"
or null if the servlet was not protected.
| Returns |
the name of the authentication scheme |
Returns the length, in bytes, of the request body and
made available by the input stream, or -1 if the length is not
known.
Returns the MIME type of the body of the request, or
null if the type is not known.
Returns the portion of the request URI that indicates
the context of the request.
Returns list containing all cookies that browser
sent with this request.
Returns the value of the specified request header as a string.
If the request did not include a header of the specified name,
this method returns null. The header name is case insensitive.
Some useful headers for detecting the client type are
"User-Agent" and "Accept".
| Parameters |
headerName -
header name
|
| Returns |
header |
Returns an array of all the header names this request contains.
Returns the name of the HTTP method with which this
request was made, for example, GET, POST, or PUT.
Returns any extra path information associated with the
URL the client sent when it made this request.
Returns the name and version of the protocol the request
uses in the form protocol/majorVersion.minorVersion, for
example, HTTP/1.1.
Returns the query string that is contained in the request
URL after the path.
Returns the Internet Protocol (IP) address of the client that sent the request.
Returns the fully qualified name of the client that sent
the request, or the IP address of the client if the name cannot
be determined.
Returns the login of the user making this request, if the
user has been authenticated, or null if the user has not been
authenticated.
Returns the session ID specified by the client.
Returns the part of this request's URL from the
protocol name up to the query string in the first line of the
HTTP request.
Returns the host name of the server that received the request.
Returns the port number on which this request was received.
Returns the part of this request's URL that calls the servlet.
Returns the current session associated with this request.
Session returned by this method is independent from
Anvil's session handling mechanism as it is provided
by enclosing servlet container.
| Parameters |
create -
If true and there is no session, returns a new session
|
Checks whether the requested session ID came in as a cookie.
Checks whether the requested session ID came in as part of the request URL.
Checks whether the requested session ID is still valid.
Attributes
object request.parameter
Parameter from request. For ordinary parameters
string is returned, for uploads anvil.io.File is returned
and for parameters containing list of angle bracketed keys
an array is returned.
References
Parameter from request. For ordinary parameters
string is returned, for uploads anvil.io.File is returned
and for parameters containing list of angle bracketed keys
an array is returned.