Packages

  • Nette
    • Application
      • Diagnostics
      • Responses
      • Routers
      • UI
    • Caching
      • Storages
    • ComponentModel
    • Config
      • Adapters
      • Extensions
    • Database
      • Diagnostics
      • Drivers
      • Reflection
      • Table
    • DI
      • Diagnostics
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
      • Macros
    • Loaders
    • Localization
    • Mail
    • Reflection
    • Security
      • Diagnostics
    • Templating
    • Utils
      • PhpGenerator
  • NetteModule
  • none

Classes

Interfaces

  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Other releases
  • Nette homepage

Class HttpRequest

HttpRequest provides access scheme for request sent via HTTP.

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

Returns URL object.

Returns URL object.

Returns

UrlScript

Implementation of

IHttpRequest::getUrl()
public
# getUri( )

Deprecated

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
string
key
$default
mixed
default value

Returns

mixed

Implementation of

IHttpRequest::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
string
key
$default
mixed
default value

Returns

mixed

Implementation of

IHttpRequest::getPost()
public HttpUploadedFile
# getFile( string $key )

Returns uploaded file.

Returns uploaded file.

Parameters

$key
string
key (or more keys)

Returns

HttpUploadedFile

Implementation of

IHttpRequest::getFile()
public array
# getFiles( )

Returns uploaded files.

Returns uploaded files.

Returns

array

Implementation of

IHttpRequest::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
string
key
$default
mixed
default value

Returns

mixed

Implementation of

IHttpRequest::getCookie()
public array
# getCookies( )

Returns variables provided to the script via HTTP cookies.

Returns variables provided to the script via HTTP cookies.

Returns

array

Implementation of

IHttpRequest::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

Implementation of

IHttpRequest::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
string

Returns

boolean

Implementation of

IHttpRequest::isMethod()
public boolean
# isPost( )

Checks if the request method is POST.

Checks if the request method is POST.

Returns

boolean
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
string
$default
mixed

Returns

mixed

Implementation of

IHttpRequest::getHeader()
public array
# getHeaders( )

Returns all HTTP headers.

Returns all HTTP headers.

Returns

array

Implementation of

IHttpRequest::getHeaders()
public Url|null
# getReferer( )

Returns referrer.

Returns referrer.

Returns

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

Implementation of

IHttpRequest::isSecured()
public boolean
# isAjax( )

Is AJAX request?

Is AJAX request?

Returns

boolean

Implementation of

IHttpRequest::isAjax()
public string
# getRemoteAddress( )

Returns the IP address of the remote client.

Returns the IP address of the remote client.

Returns

string

Implementation of

IHttpRequest::getRemoteAddress()
public string
# getRemoteHost( )

Returns the host of the remote client.

Returns the host of the remote client.

Returns

string

Implementation of

IHttpRequest::getRemoteHost()
public string
# detectLanguage( array $langs )

Parse Accept-Language header and returns prefered language.

Parse Accept-Language header and returns prefered language.

Parameters

$langs
array
Supported languages

Returns

string
Methods inherited from Object
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Constants inherited from IHttpRequest
DELETE, GET, HEAD, POST, PUT
Magic properties summary
public read-only UrlScript $url
#
public read-only mixed $query
#
public read-only boolean $post
#
public read-only array $files
#
public read-only array $cookies
#
public read-only string $method
#
public read-only array $headers
#
public read-only Url|null $referer
#
public read-only boolean $secured
#
public read-only boolean $ajax
#
public read-only string $remoteAddress
#
public read-only string $remoteHost
#
Magic properties inherited from Object
$reflection
Nette Framework 2.0.18 (for PHP 5.2, un-prefixed) API documentation generated by ApiGen 2.8.0