Interface IHttpRequest (namespace Nette\Web)
IHttpRequest provides access scheme for request sent via HTTP.
Public Method Summary | |
---|---|
mixed |
getCookie
(string $key, [mixed $default =
NULL ])
Returns variable provided to the script via HTTP cookies.
|
array |
getCookies
()
Returns variables provided to the script via HTTP cookies.
|
HttpUploadedFile |
getFile
(string $key)
Returns uploaded file.
|
array |
getFiles
()
Returns uploaded files.
|
mixed |
getHeader
(string $header, [mixed $default =
NULL ])
Return the value of the HTTP header. Pass the header name as the plain, HTTP-specified header name (e.g. 'Accept-Encoding').
|
array |
getHeaders
()
Returns all HTTP headers.
|
string |
getMethod
()
Returns HTTP request method (GET, POST, HEAD, PUT, ...). The method is case-sensitive.
|
mixed |
Returns variable provided to the script via POST method ($_POST).
|
string |
getPostRaw
()
Returns HTTP POST data in raw format (only for "application/x-www-form-urlencoded").
|
mixed |
Returns variable provided to the script via URL query ($_GET).
|
string |
Returns the IP address of the remote client.
|
string |
Returns the host of the remote client.
|
UriScript |
getUri
()
Returns URL object.
|
bool |
isAjax
()
Is AJAX request?
|
bool |
isMethod
(string $method)
Checks HTTP request method.
|
bool |
isSecured
()
Is the request is sent via secure channel (https).
|
Constant Summary | |||
---|---|---|---|
string | DELETE |
'DELETE' |
line 38 HTTP request method |
string | GET |
'GET' |
line 34 HTTP request method |
string | HEAD |
'HEAD' |
line 36 HTTP request method |
string | POST |
'POST' |
line 35 HTTP request method |
string | PUT |
'PUT' |
line 37 HTTP request method |
Method Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
line 92 getCookiepublic mixed getCookie (string $key, [mixed $default = Returns variable provided to the script via HTTP cookies.
|
|||||||||
line 98 getCookiespublic array getCookies () Returns variables provided to the script via HTTP cookies. |
|||||||||
line 78 getFilepublic HttpUploadedFile getFile (string $key) Returns uploaded file.
|
|||||||||
line 84 getFilespublic array getFiles () Returns uploaded files. |
|||||||||
line 122 getHeaderpublic mixed getHeader (string $header, [mixed $default = Return the value of the HTTP header. Pass the header name as the plain, HTTP-specified header name (e.g. 'Accept-Encoding').
|
|||||||||
line 128 getHeaderspublic array getHeaders () Returns all HTTP headers. |
|||||||||
line 106 getMethodpublic string getMethod () Returns HTTP request method (GET, POST, HEAD, PUT, ...). The method is case-sensitive. |
|||||||||
line 65 getPostpublic mixed getPost ([string $key = Returns variable provided to the script via POST method ($_POST). If no key is passed, returns the entire array.
|
|||||||||
line 71 getPostRawpublic string getPostRaw () Returns HTTP POST data in raw format (only for "application/x-www-form-urlencoded"). |
|||||||||
line 56 getQuerypublic mixed getQuery ([string $key = Returns variable provided to the script via URL query ($_GET). If no key is passed, returns the entire array.
|
|||||||||
line 146 getRemoteAddresspublic string getRemoteAddress () Returns the IP address of the remote client. |
|||||||||
line 152 getRemoteHostpublic string getRemoteHost () Returns the host of the remote client. |
|||||||||
line 45 getUripublic UriScript getUri () Returns URL object. |
|||||||||
line 140 isAjaxpublic bool isAjax () Is AJAX request? |
|||||||||
line 113 isMethodpublic bool isMethod (string $method) Checks HTTP request method.
|
|||||||||
line 134 isSecuredpublic bool isSecured () Is the request is sent via secure channel (https). |