| 1 | <?php |
||
| 23 | class RESTClientResponse { |
||
| 24 | |||
| 25 | /** @var int The HTTP status code returned by the server */ |
||
| 26 | public $status; |
||
| 27 | |||
| 28 | /** @var Mixed The response payload from the server */ |
||
| 29 | public $payload; |
||
| 30 | |||
| 31 | /** @var Array An array of headers returned by the server */ |
||
| 32 | public $headers; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Response object constructor. Response properties should be set here (rather than just setting the object properties directly). |
||
| 36 | * @param int $status The HTTP status code of the request |
||
| 37 | * @param mixed $payload The response issued by the API |
||
| 38 | * @param array $headers Any headers returned by the server |
||
| 39 | */ |
||
| 40 | public function __construct($status, $payload, array $headers = array()) { |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Searches the request headers by key |
||
| 48 | * @param String $key The key of the header to return |
||
| 49 | * @return mixed The value of the requested header |
||
| 50 | */ |
||
| 51 | public function get_header($key) { |
||
| 54 | } |