\CommuniqueRESTClientResponse

REST Response

This class is used to encapsulate the response from the API. Whilst it is used internally, it is also made available to response interceptors for reading from and/or writing to.

Summary

Methods
Properties
Constants
__construct()
get_header()
$status
$payload
$headers
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$status

$status : integer

Type

integer — The HTTP status code returned by the server

$payload

$payload : Mixed

Type

Mixed — The response payload from the server

$headers

$headers : Array

Type

Array — An array of headers returned by the server

Methods

__construct()

__construct(integer  $status, mixed  $payload, array  $headers = array()) 

Response object constructor. Response properties should be set here (rather than just setting the object properties directly).

Parameters

integer $status

The HTTP status code of the request

mixed $payload

The response issued by the API

array $headers

Any headers returned by the server

get_header()

get_header(String  $key) : mixed

Searches the request headers by key

Parameters

String $key

The key of the header to return

Returns

mixed —

The value of the requested header