AbstractRequest
extends AbstractHttp
in package
Uses
FilterableTrait
Abstract HTTP request class
Tags
Table of Contents
- $body : Body
- Body
- $filters : array<string|int, mixed>
- Form filters
- $headers : array<string|int, mixed>
- Headers
- __construct() : mixed
- Constructor
- __get() : mixed
- Magic method to get either the headers or body
- addFilter() : FilterableTrait
- Add filter
- addFilters() : FilterableTrait
- Add filters
- addHeader() : AbstractHttp
- Add a header
- addHeaders() : AbstractHttp
- Add all headers
- clearFilters() : FilterableTrait
- Clear filters
- decodeBodyContent() : Body
- Decode the body
- filter() : mixed
- Filter values
- filterAll() : array<string|int, mixed>
- Filter all values, ignoring excludes
- getBody() : Body
- Get the body
- getBodyContent() : mixed
- Get body content
- getFilters() : array<string|int, mixed>
- Get filters
- getHeader() : mixed
- Get a header
- getHeaders() : array<string|int, mixed>
- Get all headers
- getHeadersAsArray() : array<string|int, mixed>
- Get all header values as associative array
- getHeadersAsString() : string
- Get all header values formatted string
- getHeaderValue() : mixed
- Get header value
- hasBody() : bool
- Has a body
- hasBodyContent() : bool
- Has body content
- hasFilters() : bool
- Has filters
- hasHeader() : bool
- Has a header
- hasHeaders() : bool
- Determine if there are headers
- removeBody() : AbstractHttp
- Remove the body
- removeHeader() : AbstractHttp
- Remove a header
- removeHeaders() : AbstractHttp
- Remove all headers
- setBody() : AbstractHttp
- Set the body
Properties
$body
Body
protected
Body
$body
= null
$filters
Form filters
protected
array<string|int, mixed>
$filters
= []
$headers
Headers
protected
array<string|int, mixed>
$headers
= []
Methods
__construct()
Constructor
public
__construct([mixed $filters = null ]) : mixed
Instantiate the request object
Parameters
- $filters : mixed = null
Return values
mixed —__get()
Magic method to get either the headers or body
public
__get(string $name) : mixed
Parameters
- $name : string
Return values
mixed —addFilter()
Add filter
public
addFilter(mixed $filter) : FilterableTrait
Parameters
- $filter : mixed
Tags
Return values
FilterableTrait —addFilters()
Add filters
public
addFilters(array<string|int, mixed> $filters) : FilterableTrait
Parameters
- $filters : array<string|int, mixed>
Return values
FilterableTrait —addHeader()
Add a header
public
addHeader(Header|string $header[, string $value = null ]) : AbstractHttp
Parameters
- $header : Header|string
- $value : string = null
Return values
AbstractHttp —addHeaders()
Add all headers
public
addHeaders(array<string|int, mixed> $headers) : AbstractHttp
Parameters
- $headers : array<string|int, mixed>
Return values
AbstractHttp —clearFilters()
Clear filters
public
clearFilters() : FilterableTrait
Return values
FilterableTrait —decodeBodyContent()
Decode the body
public
decodeBodyContent([string $body = null ]) : Body
Parameters
- $body : string = null
Return values
Body —filter()
Filter values
public
filter(mixed $values) : mixed
Parameters
- $values : mixed
Return values
mixed —filterAll()
Filter all values, ignoring excludes
public
filterAll(array<string|int, mixed> $values) : array<string|int, mixed>
Parameters
- $values : array<string|int, mixed>
Return values
array<string|int, mixed> —getBody()
Get the body
public
getBody() : Body
Return values
Body —getBodyContent()
Get body content
public
getBodyContent() : mixed
Return values
mixed —getFilters()
Get filters
public
getFilters() : array<string|int, mixed>
Return values
array<string|int, mixed> —getHeader()
Get a header
public
getHeader(string $name) : mixed
Parameters
- $name : string
Return values
mixed —getHeaders()
Get all headers
public
getHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed> —getHeadersAsArray()
Get all header values as associative array
public
getHeadersAsArray() : array<string|int, mixed>
Return values
array<string|int, mixed> —getHeadersAsString()
Get all header values formatted string
public
getHeadersAsString([string $status = null ][, string $eol = "
" ]) : string
Parameters
- $status : string = null
- $eol : string = " "
Return values
string —getHeaderValue()
Get header value
public
getHeaderValue(string $name) : mixed
Parameters
- $name : string
Return values
mixed —hasBody()
Has a body
public
hasBody() : bool
Return values
bool —hasBodyContent()
Has body content
public
hasBodyContent() : bool
Return values
bool —hasFilters()
Has filters
public
hasFilters() : bool
Return values
bool —hasHeader()
Has a header
public
hasHeader(string $name) : bool
Parameters
- $name : string
Return values
bool —hasHeaders()
Determine if there are headers
public
hasHeaders() : bool
Return values
bool —removeBody()
Remove the body
public
removeBody() : AbstractHttp
Return values
AbstractHttp —removeHeader()
Remove a header
public
removeHeader(string $name) : AbstractHttp
Parameters
- $name : string
Return values
AbstractHttp —removeHeaders()
Remove all headers
public
removeHeaders() : AbstractHttp
Return values
AbstractHttp —setBody()
Set the body
public
setBody(string|Body $body) : AbstractHttp
Parameters
- $body : string|Body