LINE Messaging API SDK for PHP

Response
in package

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

$headers

private array<string|int, string> $headers

Methods

__construct()

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()

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()

Returns all of response headers.

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

All of the response headers.

getHTTPStatus()

Returns HTTP status code of response.

public getHTTPStatus() : int
Return values
int

HTTP status code of response.

getJSONDecodedBody()

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()

Returns raw response body.

public getRawBody() : string
Return values
string

Raw request body.

isSucceeded()

Returns request is succeeded or not.

public isSucceeded() : bool
Return values
bool

Request is succeeded or not.

Search results