Interface IHttpRequest (namespace Nette\Web)


IHttpRequest provides access scheme for request sent via HTTP.


Copyright: Copyright (c) 2004, 2010 David Grudl
Located: in /Web/IHttpRequest.php (line 21)
Public Method Summary
mixed
getCookie (string $key, [mixed $default = NULL])
Returns variable provided to the script via HTTP cookies.
array
Returns variables provided to the script via HTTP cookies.
HttpUploadedFile
getFile (string $key)
Returns uploaded file.
array
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
Returns all HTTP headers.
string
Returns HTTP request method (GET, POST, HEAD, PUT, ...). The method is case-sensitive.
mixed
getPost ([string $key = NULL], [mixed $default = NULL])
Returns variable provided to the script via POST method ($_POST).
string
Returns HTTP POST data in raw format (only for "application/x-www-form-urlencoded").
mixed
getQuery ([string $key = NULL], [mixed $default = NULL])
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
Is the request is sent via secure channel (https).
Constant Summary
string DELETE 'DELETE'

line 29

HTTP request method
string GET 'GET'

line 25

HTTP request method
string HEAD 'HEAD'

line 27

HTTP request method
string POST 'POST'

line 26

HTTP request method
string PUT 'PUT'

line 28

HTTP request method

Method Details

line 83

getCookie

public mixed getCookie (string $key, [mixed $default = NULL])

Returns variable provided to the script via HTTP cookies.

Input
string $key key
mixed $default default value

line 89

getCookies

public array getCookies ()

Returns variables provided to the script via HTTP cookies.

line 69

getFile

public HttpUploadedFile getFile (string $key)

Returns uploaded file.

Input
string $key key (or more keys)

line 75

getFiles

public array getFiles ()

Returns uploaded files.

line 113

getHeader

public 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').

Input
string $header
mixed $default

line 119

getHeaders

public array getHeaders ()

Returns all HTTP headers.

line 97

getMethod

public string getMethod ()

Returns HTTP request method (GET, POST, HEAD, PUT, ...). The method is case-sensitive.

line 56

getPost

public mixed getPost ([string $key = NULL], [mixed $default = NULL])

Returns variable provided to the script via POST method ($_POST).

If no key is passed, returns the entire array.

Input
string $key key
mixed $default default value

line 62

getPostRaw

public string getPostRaw ()

Returns HTTP POST data in raw format (only for "application/x-www-form-urlencoded").

line 47

getQuery

public mixed getQuery ([string $key = NULL], [mixed $default = NULL])

Returns variable provided to the script via URL query ($_GET).

If no key is passed, returns the entire array.

Input
string $key key
mixed $default default value

line 137

getRemoteAddress

public string getRemoteAddress ()

Returns the IP address of the remote client.

line 143

getRemoteHost

public string getRemoteHost ()

Returns the host of the remote client.

line 36

getUri

public UriScript getUri ()

Returns URL object.

line 131

isAjax

public bool isAjax ()

Is AJAX request?

line 104

isMethod

public bool isMethod (string $method)

Checks HTTP request method.

Input
string $method

line 125

isSecured

public bool isSecured ()

Is the request is sent via secure channel (https).