| 1 | <?php namespace CodeZero\Curl; | ||
| 3 | class Response | ||
| 4 | { | ||
| 5 | /** | ||
| 6 | * The Response Body | ||
| 7 | * | ||
| 8 | * @var mixed | ||
| 9 | */ | ||
| 10 | private $rawResponse; | ||
| 11 | |||
| 12 | /** | ||
| 13 | * Additional Response Information | ||
| 14 | * | ||
| 15 | * @var ResponseInfo | ||
| 16 | */ | ||
| 17 | private $responseInfo; | ||
| 18 | |||
| 19 | /** | ||
| 20 | * Constructor | ||
| 21 | * | ||
| 22 | * @param $rawResponse | ||
| 23 | * @param ResponseInfo $responseInfo | ||
| 24 | */ | ||
| 25 | public function __construct($rawResponse, ResponseInfo $responseInfo) | ||
| 30 | |||
| 31 | /** | ||
| 32 | * Response information | ||
| 33 | * | ||
| 34 | * @return ResponseInfo | ||
| 35 | */ | ||
| 36 | public function info() | ||
| 40 | |||
| 41 | /** | ||
| 42 | * Get the response body | ||
| 43 | * | ||
| 44 | * @return string | ||
| 45 | */ | ||
| 46 | public function getBody() | ||
| 50 | |||
| 51 | /** | ||
| 52 | * Output the raw response | ||
| 53 | * | ||
| 54 | * @return string | ||
| 55 | */ | ||
| 56 | public function __toString() | ||
| 60 | } | ||
| 61 |