Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationDI
      • ApplicationLatte
      • ApplicationTracy
      • CacheDI
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsDI
      • FormsLatte
      • Framework
      • HttpDI
      • HttpTracy
      • MailDI
      • ReflectionDI
      • SecurityDI
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Conventions
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
    • Reflection
    • Security
    • Utils
  • none
  • Tracy
    • Bridges
      • Nette

Classes

  • Context
  • FileUpload
  • Helpers
  • Request
  • RequestFactory
  • Response
  • Session
  • SessionSection
  • Url
  • UrlScript
  • UserStorage

Interfaces

  • IRequest
  • IResponse
  • ISessionStorage
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases
  • Nette homepage

Class Request

HttpRequest provides access scheme for request sent via HTTP.

Nette\Object
Extended by Nette\Http\Request implements Nette\Http\IRequest
Namespace: Nette\Http
Located at Http/Request.php
Methods summary
public
# __construct( Nette\Http\UrlScript $url, $query = NULL, $post = NULL, $files = NULL, $cookies = NULL, $headers = NULL, $method = NULL, $remoteAddress = NULL, $remoteHost = NULL, $rawBodyCallback = NULL )
public Nette\Http\Request
# getUrl( )

Returns URL object.

Returns URL object.

Returns

Nette\Http\Request
static

Implementation of

Nette\Http\IRequest::getUrl()
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.

Returns variable provided to the script via URL query ($_GET). If no key is passed, returns the entire array.

Parameters

$key
key
$default
value

Returns

mixed
mixed

Implementation of

Nette\Http\IRequest::getQuery()
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.

Returns variable provided to the script via POST method ($_POST). If no key is passed, returns the entire array.

Parameters

$key
key
$default
value

Returns

mixed
mixed

Implementation of

Nette\Http\IRequest::getPost()
public Nette\Http\FileUpload|null
# getFile( string $key )

Returns uploaded file.

Returns uploaded file.

Parameters

$key
key

Returns

Nette\Http\FileUpload|null
FileUpload|NULL

Implementation of

Nette\Http\IRequest::getFile()
public array
# getFiles( )

Returns uploaded files.

Returns uploaded files.

Returns

array
array

Implementation of

Nette\Http\IRequest::getFiles()
public mixed
# getCookie( string $key, mixed $default = NULL )

Returns variable provided to the script via HTTP cookies.

Returns variable provided to the script via HTTP cookies.

Parameters

$key
key
$default
value

Returns

mixed
mixed

Implementation of

Nette\Http\IRequest::getCookie()
public array
# getCookies( )

Returns variables provided to the script via HTTP cookies.

Returns variables provided to the script via HTTP cookies.

Returns

array
array

Implementation of

Nette\Http\IRequest::getCookies()
public string
# getMethod( )

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

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

Returns

string
string

Implementation of

Nette\Http\IRequest::getMethod()
public boolean
# isMethod( string $method )

Checks if the request method is the given one.

Checks if the request method is the given one.

Parameters

$method

Returns

boolean
bool

Implementation of

Nette\Http\IRequest::isMethod()
public
# isPost( )

Deprecated

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

Return the value of the HTTP header. Pass the header name as the plain, HTTP-specified header name (e.g. 'Accept-Encoding').

Parameters

$header
$default

Returns

mixed
mixed

Implementation of

Nette\Http\IRequest::getHeader()
public array
# getHeaders( )

Returns all HTTP headers.

Returns all HTTP headers.

Returns

array
array

Implementation of

Nette\Http\IRequest::getHeaders()
public Nette\Http\Url|null
# getReferer( )

Returns referrer.

Returns referrer.

Returns

Nette\Http\Url|null
Url|NULL
public boolean
# isSecured( )

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

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

Returns

boolean
bool

Implementation of

Nette\Http\IRequest::isSecured()
public boolean
# isAjax( )

Is AJAX request?

Is AJAX request?

Returns

boolean
bool

Implementation of

Nette\Http\IRequest::isAjax()
public string|null
# getRemoteAddress( )

Returns the IP address of the remote client.

Returns the IP address of the remote client.

Returns

string|null
string|NULL

Implementation of

Nette\Http\IRequest::getRemoteAddress()
public string|null
# getRemoteHost( )

Returns the host of the remote client.

Returns the host of the remote client.

Returns

string|null
string|NULL

Implementation of

Nette\Http\IRequest::getRemoteHost()
public string|null
# getRawBody( )

Returns raw content of HTTP request body.

Returns raw content of HTTP request body.

Returns

string|null
string|NULL

Implementation of

Nette\Http\IRequest::getRawBody()
public string|null
# detectLanguage( array $langs )

Parse Accept-Language header and returns preferred language.

Parse Accept-Language header and returns preferred language.

Parameters

$langs
languages

Returns

string|null
string|NULL
Methods inherited from Nette\Object
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Constants inherited from Nette\Http\IRequest
DELETE, GET, HEAD, PATCH, POST, PUT
Magic properties summary
public read-only Nette\Http\UrlScript $url
public read-only array $query
public read-only array $post
public read-only array $files
public read-only array $cookies
public read-only string $method
public read-only array $headers
public read-only Nette\Http\Url|null $referer
public read-only boolean $secured
public read-only boolean $ajax
public read-only string|null $remoteAddress
public read-only string|null $remoteHost
public read-only string|null $rawBody
Magic properties inherited from Nette\Object
$reflection
Nette 2.3-20161221 API API documentation generated by ApiGen 2.8.0