Response
in package
FinalYes
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- The headers array is a set of key/value pairs. If a header is present multiple times then the value is an array of all the values.
- __toString() : string
- Converts the response object to string containing all headers and the response content.
- getContent() : string
- getHeader() : string|array<string|int, mixed>|null
- getHeaders() : array<string|int, mixed>
- getStatusCode() : int
Properties
$content
private
string
$content
$headers
private
array<string|int, mixed>
$headers
$status
private
int
$status
Methods
__construct()
The headers array is a set of key/value pairs. If a header is present multiple times then the value is an array of all the values.
public
__construct([string $content = '' ][, int $status = 200 ][, array<string|int, mixed> $headers = [] ]) : mixed
Parameters
- $content : string = ''
-
The content of the response
- $status : int = 200
-
The response status code
- $headers : array<string|int, mixed> = []
-
An array of headers
__toString()
Converts the response object to string containing all headers and the response content.
public
__toString() : string
Return values
stringgetContent()
public
getContent() : string
Return values
stringgetHeader()
public
getHeader(string $header[, bool $first = true ]) : string|array<string|int, mixed>|null
Parameters
- $header : string
- $first : bool = true
Return values
string|array<string|int, mixed>|null —The first header value if $first is true, an array of values otherwise
getHeaders()
public
getHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>getStatusCode()
public
getStatusCode() : int