Class Request

Summary

Fully Qualified Name: Zend\Http\PhpEnvironment\Request
Extends: Request

Description

HTTP Request for current PHP environment

Methods

Name Description Defined By
__construct() Construct Instantiates request. Request
__toString() Allow PHP casting of this object AbstractMessage
fromString() A factory that produces a Request object from a well-formed Http Request string Request
getAllowCustomMethods() Request
getBasePath() Get the base path. Request
getBaseUrl() Get the base URL. Request
getContent() Get raw request body Request
getCookie() Return the Cookie header, this is the same as calling $request->getHeaders()->get('Cookie'); Request
getEnv() Return the parameter container responsible for env parameters or a single parameter value. Request
getFiles() Return the parameter container responsible for file parameters or a single file. Request
getHeader() Get all headers of a certain name/type. Request
getHeaders() Return the header container responsible for headers or all headers of a certain name/type Request
getMetadata() Retrieve all metadata or a single metadatum as specified by key Message
getMethod() Return the method for this request Request
getPost() Return the parameter container responsible for post parameters or a single post parameter. Request
getQuery() Return the parameter container responsible for query parameters or a single query parameter Request
getRequestUri() Get the request URI. Request
getServer() Return the parameter container responsible for server parameters or a single parameter value. Request
getUri() Return the URI for this request object Request
getUriString() Return the URI for this request object as a string Request
getVersion() Return the HTTP version for this request AbstractMessage
isConnect() Is this a CONNECT method request? Request
isDelete() Is this a DELETE method request? Request
isFlashRequest() Is this a Flash request? Request
isGet() Is this a GET method request? Request
isHead() Is this a HEAD method request? Request
isOptions() Is this an OPTIONS method request? Request
isPatch() Is this a PATCH method request? Request
isPost() Is this a POST method request? Request
isPropFind() Is this a PROPFIND method request? Request
isPut() Is this a PUT method request? Request
isTrace() Is this a TRACE method request? Request
isXmlHttpRequest() Is the request a Javascript XMLHttpRequest? Request
renderRequestLine() Return the formatted request line (first line) for this http request Request
setAllowCustomMethods() Request
setBasePath() Set the base path. Request
setBaseUrl() Set the base URL. Request
setContent() Set message content Message
setCookies() Set cookies Request
setEnv() 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()) Request
setFiles() 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()) Request
setHeaders() Provide an alternate Parameter Container implementation for headers in this object, (this is NOT the primary API for value setting, for that see getHeaders()) AbstractMessage
setMetadata() Set message metadata Message
setMethod() Set the method for this request Request
setPost() 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()) Request
setQuery() 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()) Request
setRequestUri() Set the request URI. Request
setServer() 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()) Request
setUri() Set the URI/URL for this request, this can be a string or an instance of Zend\Uri\Http Request
setVersion() Set the HTTP version for this object, one of 1.0, 1.1 or 2 (AbstractMessage::VERSION_10, AbstractMessage::VERSION_11, AbstractMessage::VERSION_2) AbstractMessage
toString() Request

Method Details

__construct()

Construct Instantiates request.

Parameter Name Type Description
$allowCustomMethods bool

Returns:

__toString()

Allow PHP casting of this object

Returns: string

fromString()

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

Parameter Name Type Description
$string string
$allowCustomMethods bool

Returns: \Request

getAllowCustomMethods()

Returns: bool

getBasePath()

Get the base path.

Returns: string

getBaseUrl()

Get the base URL.

Returns: string

getContent()

Get raw request body

Returns: string

getCookie()

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

Returns: \Header\Cookie|bool

getEnv()

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

Parameter Name Type Description
$name string|null Parameter
$default mixed|null Default

Returns: \Zend\Stdlib\ParametersInterface|mixed

getFiles()

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

Parameter Name Type Description
$name string|null Parameter
$default mixed|null Default

Returns: \ParametersInterface|mixed

getHeader()

Get all headers of a certain name/type.

Parameter Name Type Description
$name string|null Header
$default mixed|null Default

Returns: \Zend\Http\Headers|bool|\Zend\Http\Header\HeaderInterface|\ArrayIterator

getHeaders()

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

Parameter Name Type Description
$name string|null Header
$default mixed|null Default

Returns: \Zend\Http\Headers|bool|\Zend\Http\Header\HeaderInterface|\ArrayIterator

getMetadata()

Retrieve all metadata or a single metadatum as specified by key

Parameter Name Type Description
$key null|string|int
$default null|mixed

Returns: mixed

getMethod()

Return the method for this request

Returns: string

getPost()

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

Parameter Name Type Description
$name string|null Parameter
$default mixed|null Default

Returns: \Zend\Stdlib\ParametersInterface|mixed

getQuery()

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

Parameter Name Type Description
$name string|null Parameter
$default mixed|null Default

Returns: \Zend\Stdlib\ParametersInterface|mixed

getRequestUri()

Get the request URI.

Returns: string

getServer()

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

Parameter Name Type Description
$name string|null Parameter
$default mixed|null Default

Returns: \Zend\Stdlib\ParametersInterface|mixed

getUri()

Return the URI for this request object

Returns: \HttpUri

getUriString()

Return the URI for this request object as a string

Returns: string

getVersion()

Return the HTTP version for this request

Returns: string

isConnect()

Is this a CONNECT method request?

Returns: bool

isDelete()

Is this a DELETE method request?

Returns: bool

isFlashRequest()

Is this a Flash request?

Returns: bool

isGet()

Is this a GET method request?

Returns: bool

isHead()

Is this a HEAD method request?

Returns: bool

isOptions()

Is this an OPTIONS method request?

Returns: bool

isPatch()

Is this a PATCH method request?

Returns: bool

isPost()

Is this a POST method request?

Returns: bool

isPropFind()

Is this a PROPFIND method request?

Returns: bool

isPut()

Is this a PUT method request?

Returns: bool

isTrace()

Is this a TRACE method request?

Returns: bool

isXmlHttpRequest()

Is the request a Javascript XMLHttpRequest?

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

Returns: bool

renderRequestLine()

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

Returns: string

setAllowCustomMethods()

Parameter Name Type Description
$strictMethods bool

Returns:

setBasePath()

Set the base path.

Parameter Name Type Description
$basePath string

Returns: self

setBaseUrl()

Set the base URL.

Parameter Name Type Description
$baseUrl string

Returns: self

setContent()

Set message content

Parameter Name Type Description
$value mixed

Returns: \Message

setCookies()

Set cookies

Instantiate and set cookies.

Parameter Name Type Description
$cookie
$cookie

Returns: \Request

setEnv()

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

Parameter Name Type Description
$env \ParametersInterface

Returns: \Request

setFiles()

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

Parameter Name Type Description
$files \ParametersInterface

Returns: \Request

setHeaders()

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

Parameter Name Type Description
$headers \Headers

Returns: \AbstractMessage

setMetadata()

Set message metadata

Non-destructive setting of message metadata; always adds to the metadata, never overwrites the entire metadata container.

Parameter Name Type Description
$spec string|int|array|\Traversable
$value mixed

Returns: \Message

setMethod()

Set the method for this request

Parameter Name Type Description
$method string

Returns: \Request

setPost()

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

Parameter Name Type Description
$post \Zend\Stdlib\ParametersInterface

Returns: \Request

setQuery()

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

Parameter Name Type Description
$query \Zend\Stdlib\ParametersInterface

Returns: \Request

setRequestUri()

Set the request URI.

Parameter Name Type Description
$requestUri string

Returns: self

setServer()

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

Parameter Name Type Description
$server \ParametersInterface

Returns: \Request

setUri()

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

Parameter Name Type Description
$uri string|\HttpUri

Returns: \Request

setVersion()

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

Parameter Name Type Description
$version string (Must

Returns: \AbstractMessage

toString()

Returns: string

Top