Documentation

AbstractRequest extends AbstractRequestResponse
in package

AbstractYes

Abstract HTTP request class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
5.2.0

Table of Contents

Properties

$body  : Body|null
Body
$headers  : array<string|int, mixed>
Headers
$uri  : Uri|null
Request URI object

Methods

__construct()  : mixed
Constructor
__get()  : mixed
Magic method to get either the headers or body
addHeader()  : AbstractRequestResponse
Add a header
addHeaders()  : AbstractRequestResponse
Add all headers
decodeBodyContent()  : Body
Decode the body
getBody()  : Body
Get the body
getBodyContent()  : mixed
Get body content
getBodyContentLength()  : int
Get body content length
getHeader()  : mixed
Get a header
getHeaderAsString()  : 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
getHeaderValueAsString()  : string|null
Get header value as string
getUri()  : Uri
Get URI
getUriAsString()  : string
Get URI as string
hasBody()  : bool
Has a body
hasBodyContent()  : bool
Has body content
hasHeader()  : bool
Has a header
hasHeaders()  : bool
Determine if there are headers
hasUri()  : bool
Has URI
removeBody()  : AbstractRequestResponse
Remove the body
removeHeader()  : AbstractRequestResponse
Remove a header
removeHeaders()  : AbstractRequestResponse
Remove all headers
setBody()  : AbstractRequestResponse
Set the body
setHeaders()  : AbstractRequestResponse
Set all headers (clear out any existing headers)
setUri()  : AbstractRequest
Set URI

Properties

Methods

__construct()

Constructor

public __construct([Uri|string|null $uri = null ]) : mixed

Instantiate the request object

Parameters
$uri : Uri|string|null = null
Tags
throws
Exception

__get()

Magic method to get either the headers or body

public __get(string $name) : mixed
Parameters
$name : string

decodeBodyContent()

Decode the body

public decodeBodyContent([string|null $body = null ]) : Body
Parameters
$body : string|null = null
Return values
Body

getBodyContentLength()

Get body content length

public getBodyContentLength([bool $mb = false ]) : int
Parameters
$mb : bool = false
Return values
int

getHeaderAsString()

Get a header

public getHeaderAsString(string $name) : mixed
Parameters
$name : string

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([bool $asStrings = true ]) : array<string|int, mixed>
Parameters
$asStrings : bool = true
Return values
array<string|int, mixed>

getHeadersAsString()

Get all header values formatted string

public getHeadersAsString([mixed $status = null ][, string $eol = " " ]) : string
Parameters
$status : mixed = null
$eol : string = " "
Return values
string

getHeaderValue()

Get header value

public getHeaderValue(string $name[, int $i = 0 ]) : mixed
Parameters
$name : string
$i : int = 0

getHeaderValueAsString()

Get header value as string

public getHeaderValueAsString(string $name[, int $i = 0 ]) : string|null
Parameters
$name : string
$i : int = 0
Return values
string|null

getUriAsString()

Get URI as string

public getUriAsString() : string
Return values
string

hasHeader()

Has a header

public hasHeader(string $name) : bool
Parameters
$name : string
Return values
bool

        
On this page

Search results