Interface IHttpRequest (namespace Nette\Web)


IHttpRequest provides access scheme for request sent via HTTP.


Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Located: in /Web/IHttpRequest.php (line 29)
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 37

HTTP request method
string GET 'GET'

line 33

HTTP request method
string HEAD 'HEAD'

line 35

HTTP request method
string POST 'POST'

line 34

HTTP request method
string PUT 'PUT'

line 36

HTTP request method

Method Details

line 91

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 97

getCookies

public array getCookies ()

Returns variables provided to the script via HTTP cookies.

line 77

getFile

public HttpUploadedFile getFile (string $key)

Returns uploaded file.

Input
string $key key (or more keys)

line 83

getFiles

public array getFiles ()

Returns uploaded files.

line 121

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 127

getHeaders

public array getHeaders ()

Returns all HTTP headers.

line 105

getMethod

public string getMethod ()

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

line 64

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 70

getPostRaw

public string getPostRaw ()

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

line 55

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 145

getRemoteAddress

public string getRemoteAddress ()

Returns the IP address of the remote client.

line 151

getRemoteHost

public string getRemoteHost ()

Returns the host of the remote client.

line 44

getUri

public UriScript getUri ()

Returns URL object.

line 139

isAjax

public bool isAjax ()

Is AJAX request?

line 112

isMethod

public bool isMethod (string $method)

Checks HTTP request method.

Input
string $method

line 133

isSecured

public bool isSecured ()

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