Packages

  • Nette
    • Application
    • Caching
    • Collections
    • Config
    • Forms
    • IO
    • Loaders
    • Mail
    • Reflection
    • Security
    • Templates
    • Web
  • None
  • PHP

Classes

  • NFtp
  • NHtml
  • NHttpContext
  • NHttpRequest
  • NHttpResponse
  • NHttpUploadedFile
  • NSession
  • NSessionNamespace
  • NUri
  • NUriScript
  • NUser

Interfaces

  • IHttpRequest
  • IHttpResponse
  • IUser

Exceptions

  • NFtpException
  • Overview
  • Package
  • Class
  • Tree
  • Other releases

Class NHttpRequest

HttpRequest provides access scheme for request sent via HTTP.

NObject
Extended by NHttpRequest implements IHttpRequest
Package: Nette\Web
Author: David Grudl
Located at Web/HttpRequest.php
Methods summary
final public NUriScript
# getUri( )

Returns URL object.

Returns URL object.

Returns

NUriScript

Implementation of

IHttpRequest::getUri
public NHttpRequest
# setUri( NUriScript $uri )

Sets URL object.

Sets URL object.

Parameters

$uri
NUriScript

Returns

NHttpRequest
provides a fluent interface
final public NUri
# getOriginalUri( )

Returns URL object.

Returns URL object.

Returns

NUri
public
# addUriFilter( string $pattern, string $replacement = '', integer $component = NULL )

Sets request URI filter.

Sets request URI filter.

Parameters

$pattern
string
pattern to search for
$replacement
string
string to replace
$component
integer
PHP_URL_PATH or NULL
final public array
# getUriFilters( )

Returns request URI filter.

Returns request URI filter.

Returns

array
protected
# detectUri( )

Detects uri, base path and script path of the request.

Detects uri, base path and script path of the request.

final 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
final 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 string
# getPostRaw( )

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

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

Returns

string

Implementation of

IHttpRequest::getPostRaw
final public NHttpUploadedFile
# getFile( string $key )

Returns uploaded file.

Returns uploaded file.

Parameters

$key
string
key (or more keys)

Returns

NHttpUploadedFile

Implementation of

IHttpRequest::getFile
final public array
# getFiles( )

Returns uploaded files.

Returns uploaded files.

Returns

array

Implementation of

IHttpRequest::getFiles
final 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
final 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 NHttpRequest
# setEncoding( array $encoding )

Recursively converts and checks encoding.

Recursively converts and checks encoding.

Parameters

$encoding
array

Returns

NHttpRequest
provides a fluent interface
public
# initialize( )

Initializes $this->query, $this->files, $this->cookies and $this->files arrays

Initializes $this->query, $this->files, $this->cookies and $this->files arrays

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
final 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
final public NUri|null
# getReferer( )

Returns referrer.

Returns referrer.

Returns

NUri|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 NObject
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Constants inherited from IHttpRequest
DELETE, GET, HEAD, POST, PUT
Properties summary
protected array $query
#
protected array $post
#
protected array $files
#
protected array $cookies
#
protected NUriScript $uri
#

NHttpRequest::getUri()

NHttpRequest::getUri()

protected NUri $originalUri
#

NHttpRequest::getOriginalUri()

NHttpRequest::getOriginalUri()

protected array $headers
#

NHttpRequest::getHeaders()

NHttpRequest::getHeaders()

protected array $uriFilter array( PHP_URL_PATH => array('#/{2,}#' => '/'), // '%20' => '' 0 => array(), // '#[.,)]$#' => '' )
#
protected string $encoding
#
Nette Framework 0.9.7 (for PHP 5.2) API documentation generated by ApiGen 2.3.0