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 30)
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 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

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 98

getCookies

public array getCookies ()

Returns variables provided to the script via HTTP cookies.

line 78

getFile

public HttpUploadedFile getFile (string $key)

Returns uploaded file.

Input
string $key key (or more keys)

line 84

getFiles

public array getFiles ()

Returns uploaded files.

line 122

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 128

getHeaders

public array getHeaders ()

Returns all HTTP headers.

line 106

getMethod

public string getMethod ()

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

line 65

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 71

getPostRaw

public string getPostRaw ()

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

line 56

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 146

getRemoteAddress

public string getRemoteAddress ()

Returns the IP address of the remote client.

line 152

getRemoteHost

public string getRemoteHost ()

Returns the host of the remote client.

line 45

getUri

public UriScript getUri ()

Returns URL object.

line 140

isAjax

public bool isAjax ()

Is AJAX request?

line 113

isMethod

public bool isMethod (string $method)

Checks HTTP request method.

Input
string $method

line 134

isSecured

public bool isSecured ()

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