RequestResponseInterface
in
HTTP request/response interface
Tags
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
addHeader()
Set a header
public
addHeader(Header|string|int $header[, string|null $value = null ]) : RequestResponseInterface
Parameters
- $header : Header|string|int
- $value : string|null = null
Return values
RequestResponseInterfaceaddHeaders()
Add all headers
public
addHeaders(array<string|int, mixed> $headers) : RequestResponseInterface
Parameters
- $headers : array<string|int, mixed>
Return values
RequestResponseInterfacedecodeBodyContent()
Decode the body content
public
decodeBodyContent([string|null $body = null ]) : Body
Parameters
- $body : string|null = null
Return values
BodygetBody()
Get the body
public
getBody() : Body
Return values
BodygetBodyContent()
Get body content
public
getBodyContent() : mixed
getBodyContentLength()
Get body content length
public
getBodyContentLength([bool $mb = false ]) : int
Parameters
- $mb : bool = false
Return values
intgetHeader()
Get a header
public
getHeader(string $name) : mixed
Parameters
- $name : string
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
stringgetHeaderValue()
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|nullhasBody()
Has a body
public
hasBody() : bool
Return values
boolhasBodyContent()
Has body content
public
hasBodyContent() : bool
Return values
boolhasHeader()
Has a header
public
hasHeader(string $name) : bool
Parameters
- $name : string
Return values
boolhasHeaders()
Determine if there are headers
public
hasHeaders() : bool
Return values
boolremoveBody()
Remove the body
public
removeBody() : RequestResponseInterface
Return values
RequestResponseInterfaceremoveHeader()
Remove a header
public
removeHeader(string $name) : RequestResponseInterface
Parameters
- $name : string
Return values
RequestResponseInterfaceremoveHeaders()
Remove all headers
public
removeHeaders() : RequestResponseInterface
Return values
RequestResponseInterfacesetBody()
Set the body
public
setBody(string|Body $body) : RequestResponseInterface
Parameters
- $body : string|Body
Return values
RequestResponseInterfacesetHeaders()
Set all headers (clear out any existing headers)
public
setHeaders(array<string|int, mixed> $headers) : RequestResponseInterface
Parameters
- $headers : array<string|int, mixed>