Response
in package
REST API HTTP Client Response class.
Table of Contents
- $body : string
- Response body.
- $code : int
- Response code.
- $headers : array<string|int, mixed>
- Response headers.
- __construct() : mixed
- Initialize response.
- getBody() : string
- Get body.
- getCode() : int
- Get code.
- getHeaders() : array<string|int, mixed>
- Get headers.
- setBody() : mixed
- Set body.
- setCode() : mixed
- Set code.
- setHeaders() : mixed
- Set headers.
Properties
$body
Response body.
private
string
$body
$code
Response code.
private
int
$code
$headers
Response headers.
private
array<string|int, mixed>
$headers
Methods
__construct()
Initialize response.
public
__construct(int $code[, array<string|int, mixed> $headers = [] ][, string $body = '' ]) : mixed
Parameters
- $code : int
-
Response code.
- $headers : array<string|int, mixed> = []
-
Response headers.
- $body : string = ''
-
Response body.
Return values
mixed —getBody()
Get body.
public
getBody() : string
Return values
string —$body Response body.
getCode()
Get code.
public
getCode() : int
Return values
int —getHeaders()
Get headers.
public
getHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed> —$headers Response headers.
setBody()
Set body.
public
setBody(string $body) : mixed
Parameters
- $body : string
-
Response body.
Return values
mixed —setCode()
Set code.
public
setCode(int $code) : mixed
Parameters
- $code : int
-
Response code.
Return values
mixed —setHeaders()
Set headers.
public
setHeaders(array<string|int, mixed> $headers) : mixed
Parameters
- $headers : array<string|int, mixed>
-
Response headers.