HTTP Request

link http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5

 Methods

Allow PHP casting of this object

__toString() : string
Inherited

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

Returns

string

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

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

Parameters

$string

string

Exceptions

\Zend\Http\Exception\InvalidArgumentException

Returns

Get message content

getContent() : mixed
Inherited

inherited_from \Zend\Stdlib\Message::getContent()
inherited_from \Zend\Http\AbstractMessage::getContent()

Returns

mixed

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

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

convenience $request->getHeaders()->get('Cookie');

Returns

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

getFiles(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.

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

see \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 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

see \Zend\Http\Headers::get()

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

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

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

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

Returns

Return the URI for this request object as a string

getUriString() : string

Returns

string

Return the HTTP version for this request

getVersion() : string
Inherited

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

Returns

string

Is this a CONNECT method request?

isConnect() : bool

Returns

bool

Is this a DELETE method request?

isDelete() : bool

Returns

bool

Is this a Flash request?

isFlashRequest() : bool

Returns

bool

Is this a GET method request?

isGet() : bool

Returns

bool

Is this a HEAD method request?

isHead() : bool

Returns

bool

Is this an OPTIONS method request?

isOptions() : bool

Returns

bool

Is this a PATCH method request?

isPatch() : bool

Returns

bool

Is this a POST method request?

isPost() : bool

Returns

bool

Is this a PROPFIND method request?

isPropFind() : bool

Returns

bool

Is this a PUT method request?

isPut() : bool

Returns

bool

Is this a TRACE method request?

isTrace() : bool

Returns

bool

Is the request a Javascript XMLHttpRequest?

isXmlHttpRequest() : bool

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

Returns

bool

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

renderRequestLine() : string

Returns

string

Set message content

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

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

Parameters

$value

mixed

Returns

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

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

Parameters

Returns

Set the method for this request

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

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

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

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

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

Parameters

$version

string

(Must be 1.0 or 1.1)

Exceptions

\Zend\Http\Exception\InvalidArgumentException

Returns

toString()

toString() : string

Returns

string

 Properties

 

$content

$content : string
Inherited

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

$fileParams

$fileParams : \Zend\Stdlib\ParametersInterface

 

$headers

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

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

$method

$method : string

 

$postParams

$postParams : \Zend\Stdlib\ParametersInterface

 

$queryParams

$queryParams : \Zend\Stdlib\ParametersInterface

 

$uri

$uri : string | \Zend\Uri\Http

 

$version

$version : string
Inherited

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

 Constants

 

METHOD_CONNECT

METHOD_CONNECT 

 

METHOD_DELETE

METHOD_DELETE 

 

METHOD_GET

METHOD_GET 

 

METHOD_HEAD

METHOD_HEAD 

 

METHOD_OPTIONS

METHOD_OPTIONS 

 

METHOD_PATCH

METHOD_PATCH 

 

METHOD_POST

METHOD_POST 

 

METHOD_PROPFIND

METHOD_PROPFIND 

 

METHOD_PUT

METHOD_PUT 

 

METHOD_TRACE

METHOD_TRACE 

 

VERSION_10

VERSION_10 
Inherited

inherited_from \Zend\Http\AbstractMessage::VERSION_10
 

VERSION_11

VERSION_11 
Inherited

inherited_from \Zend\Http\AbstractMessage::VERSION_11