HTTP Request for current PHP environment

 Methods

Construct Instantiates request.

__construct() 

Allow PHP casting of this object

__toString() : string
Inherited

inherited_from \Zend\Http\AbstractMessage::__toString()
inherited_from \Zend\Http\Request::__toString()

Returns

string

A factory that produces a Request object from a well-formed Http Request string

fromString(string $string) : \Zend\Http\Request
Inherited

inherited_from \Zend\Http\Request::fromString()

Parameters

$string

string

Exceptions

\Zend\Http\Exception\InvalidArgumentException

Returns

Get the base path.

getBasePath() : string

Returns

string

Get the base URL.

getBaseUrl() : string

Returns

string

Get raw request body

getContent() : string

Returns

string

Return the Cookie header, this is the same as calling $request->getHeaders()->get('Cookie');

getCookie() : \Zend\Http\Header\Cookie
Inherited

convenience $request->getHeaders()->get('Cookie');
inherited_from \Zend\Http\Request::getCookie()

Returns

Return the parameter container responsible for env parameters or a single parameter value.

getEnv(string | null $name, mixed | null $default) : \Zend\Stdlib\ParametersInterface | mixed

Parameters

$name

stringnull

Parameter name to retrieve, or null to get the whole container.

$default

mixednull

Default value to use when the parameter is missing. * @return \Zend\Stdlib\ParametersInterface

Returns

Return the parameter container responsible for file parameters or a single file.

getFiles(string | null $name, mixed | null $default) : \Zend\Stdlib\ParametersInterface | mixed
Inherited

inherited_from \Zend\Http\Request::getFiles()

Parameters

$name

stringnull

Parameter name to retrieve, or null to get the whole container.

$default

mixednull

Default value to use when the parameter is missing.

Returns

Get all headers of a certain name/type.

getHeader(string | null $name, mixed | null $default) : \Zend\Http\Headers | bool | \Zend\Http\Header\HeaderInterface | \ArrayIterator
Inherited

see \Zend\Http\Request::getHeaders()
inherited_from \Zend\Http\Request::getHeader()

Parameters

$name

stringnull

Header name to retrieve, or null to get the whole container.

$default

mixednull

Default value to use when the requested header is missing.

Returns

Return the header container responsible for headers or all headers of a certain name/type

getHeaders(string | null $name, mixed | null $default) : \Zend\Http\Headers | bool | \Zend\Http\Header\HeaderInterface | \ArrayIterator
Inherited

see \Zend\Http\Headers::get()
inherited_from \Zend\Http\Request::getHeaders()

Parameters

$name

stringnull

Header name to retrieve, or null to get the whole container.

$default

mixednull

Default value to use when the requested header is missing.

Returns

Return the method for this request

getMethod() : string
Inherited

inherited_from \Zend\Http\Request::getMethod()

Returns

string

Return the parameter container responsible for post parameters or a single post parameter.

getPost(string | null $name, mixed | null $default) : \Zend\Stdlib\ParametersInterface | mixed
Inherited

inherited_from \Zend\Http\Request::getPost()

Parameters

$name

stringnull

Parameter name to retrieve, or null to get the whole container.

$default

mixednull

Default value to use when the parameter is missing.

Returns

Return the parameter container responsible for query parameters or a single query parameter

getQuery(string | null $name, mixed | null $default) : \Zend\Stdlib\ParametersInterface | mixed
Inherited

inherited_from \Zend\Http\Request::getQuery()

Parameters

$name

stringnull

Parameter name to retrieve, or null to get the whole container.

$default

mixednull

Default value to use when the parameter is missing.

Returns

Get the request URI.

getRequestUri() : string

Returns

string

Return the parameter container responsible for server parameters or a single parameter value.

getServer(string | null $name, mixed | null $default) : \Zend\Stdlib\ParametersInterface | mixed

see \Zend\Http\PhpEnvironment\http://www.faqs.org/rfcs/rfc3875.html

Parameters

$name

stringnull

Parameter name to retrieve, or null to get the whole container.

$default

mixednull

Default value to use when the parameter is missing.

Returns

Return the URI for this request object

getUri() : \Zend\Uri\Http
Inherited

inherited_from \Zend\Http\Request::getUri()

Returns

Return the URI for this request object as a string

getUriString() : string
Inherited

inherited_from \Zend\Http\Request::getUriString()

Returns

string

Return the HTTP version for this request

getVersion() : string
Inherited

inherited_from \Zend\Http\AbstractMessage::getVersion()
inherited_from \Zend\Http\Request::getVersion()

Returns

string

Is this a CONNECT method request?

isConnect() : bool
Inherited

inherited_from \Zend\Http\Request::isConnect()

Returns

bool

Is this a DELETE method request?

isDelete() : bool
Inherited

inherited_from \Zend\Http\Request::isDelete()

Returns

bool

Is this a Flash request?

isFlashRequest() : bool
Inherited

inherited_from \Zend\Http\Request::isFlashRequest()

Returns

bool

Is this a GET method request?

isGet() : bool
Inherited

inherited_from \Zend\Http\Request::isGet()

Returns

bool

Is this a HEAD method request?

isHead() : bool
Inherited

inherited_from \Zend\Http\Request::isHead()

Returns

bool

Is this an OPTIONS method request?

isOptions() : bool
Inherited

inherited_from \Zend\Http\Request::isOptions()

Returns

bool

Is this a PATCH method request?

isPatch() : bool
Inherited

inherited_from \Zend\Http\Request::isPatch()

Returns

bool

Is this a POST method request?

isPost() : bool
Inherited

inherited_from \Zend\Http\Request::isPost()

Returns

bool

Is this a PROPFIND method request?

isPropFind() : bool
Inherited

inherited_from \Zend\Http\Request::isPropFind()

Returns

bool

Is this a PUT method request?

isPut() : bool
Inherited

inherited_from \Zend\Http\Request::isPut()

Returns

bool

Is this a TRACE method request?

isTrace() : bool
Inherited

inherited_from \Zend\Http\Request::isTrace()

Returns

bool

Is the request a Javascript XMLHttpRequest?

isXmlHttpRequest() : bool
Inherited

Should work with Prototype/Script.aculo.us, possibly others.

inherited_from \Zend\Http\Request::isXmlHttpRequest()

Returns

bool

Return the formatted request line (first line) for this http request

renderRequestLine() : string
Inherited

inherited_from \Zend\Http\Request::renderRequestLine()

Returns

string

Set the base path.

setBasePath(string $basePath) : \Zend\Http\PhpEnvironment\self

Parameters

$basePath

string

Returns

\Zend\Http\PhpEnvironment\self

Set the base URL.

setBaseUrl(string $baseUrl) : \Zend\Http\PhpEnvironment\self

Parameters

$baseUrl

string

Returns

\Zend\Http\PhpEnvironment\self

Set message content

setContent(mixed $value) : \Zend\Stdlib\Message
Inherited

inherited_from \Zend\Stdlib\Message::setContent()
inherited_from \Zend\Http\AbstractMessage::setContent()
inherited_from \Zend\Http\Request::setContent()

Parameters

$value

mixed

Returns

Set cookies

setCookies($cookie) : \Zend\Http\PhpEnvironment\Request

Instantiate and set cookies.

Parameters

$cookie

Returns

Provide an alternate Parameter Container implementation for env parameters in this object, (this is NOT the primary API for value setting, for that see env())

setEnv(\Zend\Stdlib\ParametersInterface $env) : \Zend\Http\PhpEnvironment\Request

Provide an alternate Parameter Container implementation for file parameters in this object, (this is NOT the primary API for value setting, for that see getFiles())

setFiles(\Zend\Stdlib\ParametersInterface $files) : \Zend\Http\Request
Inherited

inherited_from \Zend\Http\Request::setFiles()

Parameters

Returns

Provide an alternate Parameter Container implementation for headers in this object, (this is NOT the primary API for value setting, for that see getHeaders())

setHeaders(\Zend\Http\Headers $headers) : \Zend\Http\AbstractMessage
Inherited

see \Zend\Http\getHeaders()
inherited_from \Zend\Http\AbstractMessage::setHeaders()
inherited_from \Zend\Http\Request::setHeaders()

Parameters

Returns

Set the method for this request

setMethod(string $method) : \Zend\Http\Request
Inherited

inherited_from \Zend\Http\Request::setMethod()

Parameters

$method

string

Exceptions

\Zend\Http\Exception\InvalidArgumentException

Returns

Provide an alternate Parameter Container implementation for post parameters in this object, (this is NOT the primary API for value setting, for that see getPost())

setPost(\Zend\Stdlib\ParametersInterface $post) : \Zend\Http\Request
Inherited

inherited_from \Zend\Http\Request::setPost()

Parameters

Returns

Provide an alternate Parameter Container implementation for query parameters in this object, (this is NOT the primary API for value setting, for that see getQuery())

setQuery(\Zend\Stdlib\ParametersInterface $query) : \Zend\Http\Request
Inherited

inherited_from \Zend\Http\Request::setQuery()

Parameters

Returns

Set the request URI.

setRequestUri(string $requestUri) : \Zend\Http\PhpEnvironment\self

Parameters

$requestUri

string

Returns

\Zend\Http\PhpEnvironment\self

Provide an alternate Parameter Container implementation for server parameters in this object, (this is NOT the primary API for value setting, for that see getServer())

setServer(\Zend\Stdlib\ParametersInterface $server) : \Zend\Http\PhpEnvironment\Request

Set the URI/URL for this request, this can be a string or an instance of Zend\Uri\Http

setUri(string | \Zend\Uri\Http $uri) : \Zend\Http\Request
Inherited

inherited_from \Zend\Http\Request::setUri()

Parameters

$uri

string\Zend\Uri\Http

Exceptions

\Zend\Http\Exception\InvalidArgumentException

Returns

Set the HTTP version for this object, one of 1.0 or 1.1 (AbstractMessage::VERSION_10, AbstractMessage::VERSION_11)

setVersion(string $version) : \Zend\Http\AbstractMessage
Inherited

inherited_from \Zend\Http\AbstractMessage::setVersion()
inherited_from \Zend\Http\Request::setVersion()

Parameters

$version

string

(Must be 1.0 or 1.1)

Exceptions

\Zend\Http\Exception\InvalidArgumentException

Returns

toString()

toString() : string
Inherited

inherited_from \Zend\Http\Request::toString()

Returns

string

Autodetect the base path of the request

detectBasePath() : string

Uses several criteria to determine the base path of the request.

Returns

string

Auto-detect the base path from the request environment

detectBaseUrl() : string

Uses a variety of criteria in order to detect the base URL of the request (i.e., anything additional to the document root).

Returns

string

Detect the base URI for the request

detectRequestUri() : string

Looks at a variety of criteria in order to attempt to autodetect a base URI, including rewrite URIs, proxy URIs, etc.

Returns

string

mapPhpFileParam()

mapPhpFileParam(array $array, string $paramName, int | string $index, string | array $value) 

Parameters

$array

array

$paramName

string

$index

intstring

$value

stringarray

Convert PHP superglobal $_FILES into more sane parameter=value structure This handles form file input with brackets (name=files[])

mapPhpFiles() : array

Returns

array

 Properties

 

Base Path of the application.

$basePath : string

 

Base URL of the application.

$baseUrl : string

 

$content

$content : string
Inherited

inherited_from \Zend\Stdlib\Message::$$content
inherited_from \Zend\Http\AbstractMessage::$$content
inherited_from \Zend\Http\Request::$$content
 

PHP environment params ($_ENV)

$envParams : \Zend\Stdlib\ParametersInterface

 

$fileParams

$fileParams : \Zend\Stdlib\ParametersInterface
Inherited

inherited_from \Zend\Http\Request::$$fileParams
 

$headers

$headers : \Zend\Http\Headers | null
Inherited

inherited_from \Zend\Http\AbstractMessage::$$headers
inherited_from \Zend\Http\Request::$$headers
   

$method

$method : string
Inherited

inherited_from \Zend\Http\Request::$$method
 

$postParams

$postParams : \Zend\Stdlib\ParametersInterface
Inherited

inherited_from \Zend\Http\Request::$$postParams
 

$queryParams

$queryParams : \Zend\Stdlib\ParametersInterface
Inherited

inherited_from \Zend\Http\Request::$$queryParams
 

Actual request URI, independent of the platform.

$requestUri : string

 

PHP server params ($_SERVER)

$serverParams : \Zend\Stdlib\ParametersInterface

 

$uri

$uri : string | \Zend\Uri\Http
Inherited

inherited_from \Zend\Http\Request::$$uri
 

$version

$version : string
Inherited

inherited_from \Zend\Http\AbstractMessage::$$version
inherited_from \Zend\Http\Request::$$version

 Constants

 

METHOD_CONNECT

METHOD_CONNECT 
Inherited

inherited_from \Zend\Http\Request::METHOD_CONNECT
 

METHOD_DELETE

METHOD_DELETE 
Inherited

inherited_from \Zend\Http\Request::METHOD_DELETE
 

METHOD_GET

METHOD_GET 
Inherited

inherited_from \Zend\Http\Request::METHOD_GET
 

METHOD_HEAD

METHOD_HEAD 
Inherited

inherited_from \Zend\Http\Request::METHOD_HEAD
 

METHOD_OPTIONS

METHOD_OPTIONS 
Inherited

inherited_from \Zend\Http\Request::METHOD_OPTIONS
 

METHOD_PATCH

METHOD_PATCH 
Inherited

inherited_from \Zend\Http\Request::METHOD_PATCH
 

METHOD_POST

METHOD_POST 
Inherited

inherited_from \Zend\Http\Request::METHOD_POST
 

METHOD_PROPFIND

METHOD_PROPFIND 
Inherited

inherited_from \Zend\Http\Request::METHOD_PROPFIND
 

METHOD_PUT

METHOD_PUT 
Inherited

inherited_from \Zend\Http\Request::METHOD_PUT
 

METHOD_TRACE

METHOD_TRACE 
Inherited

inherited_from \Zend\Http\Request::METHOD_TRACE
 

VERSION_10

VERSION_10 
Inherited

inherited_from \Zend\Http\AbstractMessage::VERSION_10
inherited_from \Zend\Http\Request::VERSION_10
 

VERSION_11

VERSION_11 
Inherited

inherited_from \Zend\Http\AbstractMessage::VERSION_11
inherited_from \Zend\Http\Request::VERSION_11