Properties

$filters

$filters : array

Form filters

Type

array

$headers

$headers : array

Headers

Type

array

$fields

$fields : array

Fields (form fields and files) $fields = [ 'username' => 'admin' 'file1' => [ 'filename' => __DIR__ . '/path/to/file.txt', 'contentType' => 'text/plain' ], 'file2' => [ 'filename' => 'test.pdf', 'contentType' => 'application/pdf', 'contents' => file_get_contents(__DIR__ . '/path/to/test.pdf' ] ]

Type

array

$query

$query : string

Request query

Type

string

$formType

$formType : string

Request form type

Type

string

Methods

__construct()

__construct(mixed  $filters = null) 

Constructor

Instantiate the request object

Parameters

mixed $filters

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 either the headers or body

Parameters

string $name

Returns

mixed

setField()

setField(string  $name, mixed  $value) : \Pop\Http\Client\Request

Set a field

Parameters

string $name
mixed $value

Returns

\Pop\Http\Client\Request

setFields()

setFields(array  $fields) : \Pop\Http\Client\Request

Set all fields

Parameters

array $fields

Returns

\Pop\Http\Client\Request

getField()

getField(string  $name) : mixed

Get a field

Parameters

string $name

Returns

mixed

getFields()

getFields() : array

Get all field

Returns

array

hasFields()

hasFields() : boolean

Has fields

Returns

boolean

hasField()

hasField(string  $name) : boolean

Has field

Parameters

string $name

Returns

boolean

removeField()

removeField(string  $name) : \Pop\Http\Client\Request

Remove a field

Parameters

string $name

Returns

\Pop\Http\Client\Request

prepareQuery()

prepareQuery() : string

Prepare the HTTP query

Returns

string

hasQuery()

hasQuery() : string

Is HTTP query prepared

Returns

string

getQuery()

getQuery() : string

Get HTTP query

Returns

string

getQueryLength()

getQueryLength(boolean  $mb = false) : integer

Get HTTP query length

Parameters

boolean $mb

Returns

integer

isJson()

isJson() : boolean

Check if request is JSON

Returns

boolean

createUrlEncodedForm()

createUrlEncodedForm() : \Pop\Http\Client\Request

Create request as a URL-encoded form

Returns

\Pop\Http\Client\Request

isUrlEncodedForm()

isUrlEncodedForm() : boolean

Check if request is a URL-encoded form

Returns

boolean

createMultipartForm()

createMultipartForm() : \Pop\Http\Client\Request

Create request as a multipart form

Returns

\Pop\Http\Client\Request

isMultipartForm()

isMultipartForm() : boolean

Check if request is a multipart form

Returns

boolean

getFormType()

getFormType() : string

Get form type

Returns

string