Request
class Request extends Object implements IRequest
HttpRequest provides access scheme for request sent via HTTP.
Properties
UrlScript read-only | $url | ||
array read-only | $query | ||
array read-only | $post | ||
array read-only | $files | ||
array read-only | $cookies | ||
string read-only | $method | ||
array read-only | $headers | ||
Url|null read-only | $referer | ||
bool read-only | $secured | ||
bool read-only | $ajax | ||
string|null read-only | $remoteAddress | ||
string|null read-only | $remoteHost | ||
string|null read-only | $rawBody |
Methods
No description
Returns variable provided to the script via URL query ($_GET).
Returns variable provided to the script via POST method ($_POST).
Returns uploaded file.
Returns uploaded files.
Returns variable provided to the script via HTTP cookies.
Returns variables provided to the script via HTTP cookies.
Returns HTTP request method (GET, POST, HEAD, PUT, ...). The method is case-sensitive.
Checks if the request method is the given one.
Return the value of the HTTP header. Pass the header name as the plain, HTTP-specified header name (e.g. 'Accept-Encoding').
Returns all HTTP headers.
Returns referrer.
Is the request is sent via secure channel (https).
Is AJAX request?
Returns the IP address of the remote client.
Returns the host of the remote client.
Returns raw content of HTTP request body.
Parse Accept-Language header and returns preferred language.
Details
at line 60
__construct(UrlScript $url, $query = NULL, $post = NULL, $files = NULL, $cookies = NULL, $headers = NULL, $method = NULL, $remoteAddress = NULL, $remoteHost = NULL, $rawBodyCallback = NULL)
No description
at line 83
UrlScript
getUrl()
Returns URL object.
at line 99
mixed
getQuery($key = NULL, $default = NULL)
Returns variable provided to the script via URL query ($_GET).
If no key is passed, returns the entire array.
at line 116
mixed
getPost($key = NULL, $default = NULL)
Returns variable provided to the script via POST method ($_POST).
If no key is passed, returns the entire array.
at line 135
FileUpload|null
getFile($key)
Returns uploaded file.
at line 150
array
getFiles()
Returns uploaded files.
at line 162
mixed
getCookie($key, $default = NULL)
Returns variable provided to the script via HTTP cookies.
at line 172
array
getCookies()
Returns variables provided to the script via HTTP cookies.
at line 185
string
getMethod()
Returns HTTP request method (GET, POST, HEAD, PUT, ...). The method is case-sensitive.
at line 196
bool
isMethod($method)
Checks if the request method is the given one.
at line 205
isPost()
deprecated
deprecated
No description
at line 218
mixed
getHeader($header, $default = NULL)
Return the value of the HTTP header. Pass the header name as the plain, HTTP-specified header name (e.g. 'Accept-Encoding').
at line 229
array
getHeaders()
Returns all HTTP headers.
at line 239
Url|null
getReferer()
Returns referrer.
at line 249
bool
isSecured()
Is the request is sent via secure channel (https).
at line 259
bool
isAjax()
Is AJAX request?
at line 269
string|null
getRemoteAddress()
Returns the IP address of the remote client.
at line 279
string|null
getRemoteHost()
Returns the host of the remote client.
at line 292
string|null
getRawBody()
Returns raw content of HTTP request body.
at line 303
string|null
detectLanguage(array $langs)
Parse Accept-Language header and returns preferred language.