Properties

$filters

$filters : array

Form filters

Type

array

$headers

$headers : array

Headers

Type

array

$cookie

$cookie : array

COOKIE array

Type

array

$server

$server : array

SERVER array

Type

array

$env

$env : array

ENV array

Type

array

Methods

__construct()

__construct(string  $uri = null, string  $basePath = null, mixed  $filters = null, mixed  $streamToFile = null) 

Constructor

Instantiate the request object

Parameters

string $uri
string $basePath
mixed $filters
mixed $streamToFile

filter()

filter(mixed  $values) : array

Filter values

Parameters

mixed $values

Returns

array

addFilter()

addFilter(mixed  $filter) : \Pop\Filter\FilterableTrait

Add filter

Parameters

mixed $filter

Throws

\InvalidArgumentException

Returns

\Pop\Filter\FilterableTrait

addFilters()

addFilters(array  $filters) : \Pop\Filter\FilterableTrait

Add filters

Parameters

array $filters

Returns

\Pop\Filter\FilterableTrait

hasFilters()

hasFilters() : boolean

Has filters

Returns

boolean

getFilters()

getFilters() : array

Get filters

Returns

array

filterAll()

filterAll(array  $values) : array

Filter all values, ignoring excludes

Parameters

array $values

Returns

array

addHeader()

addHeader(\Pop\Mime\Part\Header|string  $header, string  $value = null) : \Pop\Http\AbstractHttp

Add a header

Parameters

\Pop\Mime\Part\Header|string $header
string $value

Returns

\Pop\Http\AbstractHttp

addHeaders()

addHeaders(array  $headers) : \Pop\Http\AbstractHttp

Add all headers

Parameters

array $headers

Returns

\Pop\Http\AbstractHttp

getHeader()

getHeader(string  $name) : mixed

Get a header

Parameters

string $name

Returns

mixed

getHeaderValue()

getHeaderValue(string  $name) : mixed

Get header value

Parameters

string $name

Returns

mixed

getHeaders()

getHeaders() : array

Get all headers

Returns

array

getHeadersAsArray()

getHeadersAsArray() : array

Get all header values as associative array

Returns

array

getHeadersAsString()

getHeadersAsString(string  $status = null, string  $eol = "\r\n") : string

Get all header values formatted string

Parameters

string $status
string $eol

Returns

string

hasHeaders()

hasHeaders() : boolean

Determine if there are headers

Returns

boolean

hasHeader()

hasHeader(string  $name) : boolean

Has a header

Parameters

string $name

Returns

boolean

removeHeader()

removeHeader(string  $name) : \Pop\Http\AbstractHttp

Remove a header

Parameters

string $name

Returns

\Pop\Http\AbstractHttp

getBodyContent()

getBodyContent() : mixed

Get body content

Returns

mixed

hasBody()

hasBody() : boolean

Has a body

Returns

boolean

hasBodyContent()

hasBodyContent() : boolean

Has body content

Returns

boolean

decodeBodyContent()

decodeBodyContent(string  $body = null) : \Pop\Mime\Part\Body

Decode the body

Parameters

string $body

Returns

\Pop\Mime\Part\Body

__get()

__get(string  $name) : mixed

Magic method to get a value from one of the server/environment variables

Parameters

string $name

Returns

mixed

isGet()

isGet() : boolean

Return whether or not the method is GET

Returns

boolean

isHead()

isHead() : boolean

Return whether or not the method is HEAD

Returns

boolean

isPost()

isPost() : boolean

Return whether or not the method is POST

Returns

boolean

isPut()

isPut() : boolean

Return whether or not the method is PUT

Returns

boolean

isDelete()

isDelete() : boolean

Return whether or not the method is DELETE

Returns

boolean

isTrace()

isTrace() : boolean

Return whether or not the method is TRACE

Returns

boolean

isOptions()

isOptions() : boolean

Return whether or not the method is OPTIONS

Returns

boolean

isConnect()

isConnect() : boolean

Return whether or not the method is CONNECT

Returns

boolean

isPatch()

isPatch() : boolean

Return whether or not the method is PATCH

Returns

boolean

isSecure()

isSecure() : boolean

Return whether or not the request is secure

Returns

boolean

getDocumentRoot()

getDocumentRoot() : string

Get the document root

Returns

string

getMethod()

getMethod() : string

Get the method

Returns

string

getPort()

getPort() : string

Get the server port

Returns

string

getScheme()

getScheme() : string

Get scheme

Returns

string

getHost()

getHost() : string

Get host without port)

Returns

string

getFullHost()

getFullHost() : string

Get host with port

Returns

string

getIp()

getIp(boolean  $proxy = true) : string

Get client's IP

Parameters

boolean $proxy

Returns

string

getCookie()

getCookie(string  $key = null) : string|array

Get a value from $_COOKIE, or the whole array

Parameters

string $key

Returns

string|array

getServer()

getServer(string  $key = null) : string|array

Get a value from $_SERVER, or the whole array

Parameters

string $key

Returns

string|array

getEnv()

getEnv(string  $key = null) : string|array

Get a value from $_ENV, or the whole array

Parameters

string $key

Returns

string|array

getBasePath()

getBasePath() : string

Get the base path

Returns

string

getRequestUri()

getRequestUri() : string

Get the request URI

Returns

string

getFullRequestUri()

getFullRequestUri() : string

Get the full request URI, including base path

Returns

string

getSegment()

getSegment(integer  $i) : string

Get a path segment, divided by the forward slash, where $i refers to the array key index, i.e., 0 1 2 /hello/world/page

Parameters

integer $i

Returns

string

getSegments()

getSegments() : array

Get all path segments

Returns

array

setBasePath()

setBasePath(string  $path = null) : \Pop\Http\Server\Request

Set the base path

Parameters

string $path

Returns

\Pop\Http\Server\Request

hasFiles()

hasFiles() : boolean

Return whether or not the request has FILES

Returns

boolean

getQuery()

getQuery(string  $key = null) : string|array

Get a value from $_GET, or the whole array

Parameters

string $key

Returns

string|array

getPost()

getPost(string  $key = null) : string|array

Get a value from $_POST, or the whole array

Parameters

string $key

Returns

string|array

getFiles()

getFiles(string  $key = null) : string|array

Get a value from $_FILES, or the whole array

Parameters

string $key

Returns

string|array

getPut()

getPut(string  $key = null) : string|array

Get a value from PUT query data, or the whole array

Parameters

string $key

Returns

string|array

getPatch()

getPatch(string  $key = null) : string|array

Get a value from PATCH query data, or the whole array

Parameters

string $key

Returns

string|array

getDelete()

getDelete(string  $key = null) : string|array

Get a value from DELETE query data, or the whole array

Parameters

string $key

Returns

string|array

getQueryData()

getQueryData(string  $key = null) : string|array

Get a value from query data, or the whole array

Parameters

string $key

Returns

string|array

hasQueryData()

hasQueryData() : boolean

Has query data

Returns

boolean

getParsedData()

getParsedData(string  $key = null) : string|array

Get a value from parsed data, or the whole array

Parameters

string $key

Returns

string|array

hasParsedData()

hasParsedData() : boolean

Has parsed data

Returns

boolean

getRawData()

getRawData() : string

Get the raw data

Returns

string

hasRawData()

hasRawData() : boolean

Has raw data

Returns

boolean