Documentation

RequestResponseInterface
in

HTTP request/response interface

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

Methods

addHeader()  : RequestResponseInterface
Set a header
addHeaders()  : RequestResponseInterface
Add all headers
decodeBodyContent()  : Body
Decode the body content
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
hasBody()  : bool
Has a body
hasBodyContent()  : bool
Has body content
hasHeader()  : bool
Has a header
hasHeaders()  : bool
Determine if there are headers
removeBody()  : RequestResponseInterface
Remove the body
removeHeader()  : RequestResponseInterface
Remove a header
removeHeaders()  : RequestResponseInterface
Remove all headers
setBody()  : RequestResponseInterface
Set the body
setHeaders()  : RequestResponseInterface
Set all headers (clear out any existing headers)

Methods

decodeBodyContent()

Decode the body content

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() : array<string|int, mixed>
Return values
array<string|int, mixed>

getHeadersAsString()

Get all header values formatted string

public getHeadersAsString([string|null $status = null ][, string $eol = " " ]) : string
Parameters
$status : string|null = 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

hasHeader()

Has a header

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

        
On this page

Search results