Menu

## Response
in package

Response.php : 26

A class represents API response.

### Table of Contents

$body : string
$headers : array<string|int, string>
$httpStatus : int
__construct() : mixed
  Response constructor.
getHeader() : string|null
  Returns the value of the specified response header.
getHeaders() : array<string|int, string>
  Returns all of response headers.
getHTTPStatus() : int
  Returns HTTP status code of response.
getJSONDecodedBody() : array<string|int, mixed>
  Returns response body as array (it means, returns JSON decoded body).
getRawBody() : string
  Returns raw response body.
isSucceeded() : bool
  Returns request is succeeded or not.

### Properties

#### $body

Response.php : 31
`private string $body`

#### $headers

Response.php : 33
`private array<string|int, string> $headers`

#### $httpStatus

Response.php : 29
`private int $httpStatus`

### Methods

#### __construct()

Response.php : 42

Response constructor.

`public __construct(int $httpStatus, string $body[, array<string|int, string> $headers = [] ]) : mixed`

##### Parameters

$httpStatus : int

  HTTP status code of response.

$body : string

  Request body.

$headers : array<string|int, string> = []

##### Return values

mixed —

#### getHeader()

Response.php : 95

Returns the value of the specified response header.

`public getHeader(string $name) : string|null`

##### Parameters

$name : string

  A String specifying the header name.

##### Return values

string|null —

A response header string, or null if the response does not have a header of that name.

#### getHeaders()

Response.php : 108

Returns all of response headers.

`public getHeaders() : array<string|int, string>`

##### Return values

array<string|int, string> —

All of the response headers.

#### getHTTPStatus()

Response.php : 54

Returns HTTP status code of response.

`public getHTTPStatus() : int`

##### Return values

int —

HTTP status code of response.

#### getJSONDecodedBody()

Response.php : 84

Returns response body as array (it means, returns JSON decoded body).

`public getJSONDecodedBody() : array<string|int, mixed>`

##### Return values

array<string|int, mixed> —

Request body that is JSON decoded.

#### getRawBody()

Response.php : 74

Returns raw response body.

`public getRawBody() : string`

##### Return values

string —

Raw request body.

#### isSucceeded()

Response.php : 64

Returns request is succeeded or not.

`public isSucceeded() : bool`

##### Return values

bool —

Request is succeeded or not.

## Search results