|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* @category Brownie/HttpClient |
|
4
|
|
|
* @author Brownie <[email protected]> |
|
5
|
|
|
* @license http://www.gnu.org/copyleft/lesser.html |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
namespace Brownie\HttpClient; |
|
9
|
|
|
|
|
10
|
|
|
use Brownie\HttpClient\Cookie\CookieList; |
|
11
|
|
|
use Brownie\HttpClient\Header\HeaderList; |
|
12
|
|
|
use Brownie\Util\StorageArray; |
|
13
|
|
|
|
|
14
|
|
|
/** |
|
15
|
|
|
* HTTP client response. |
|
16
|
|
|
* |
|
17
|
|
|
* @method Response setBody(string $responseBody) Sets response body. |
|
18
|
|
|
* @method string getBody() Returns response body. |
|
19
|
|
|
* @method Response setHttpCode(int $httpCode) Sets HTTP response code. |
|
20
|
|
|
* @method int getHttpCode() Returns HTTP response code. |
|
21
|
|
|
* @method Response setRuntime(float $runtime) Sets request execution time. |
|
22
|
|
|
* @method float getRuntime() Returns request execution time. |
|
23
|
|
|
* @method Response setHttpHeaderList(HeaderList $headerList) Sets the headers of the http response. |
|
24
|
|
|
* @method HeaderList getHttpHeaderList() Returns the headers of the http response. |
|
25
|
|
|
* @method Response setHttpCookieList(CookieList $cookieList) Sets the cookies of the http response. |
|
26
|
|
|
* @method CookieList getHttpCookieList() Returns the cookies of the http response. |
|
27
|
|
|
*/ |
|
28
|
|
|
class Response extends StorageArray |
|
29
|
|
|
{ |
|
30
|
|
|
|
|
31
|
|
|
protected $fields = array( |
|
32
|
|
|
'body' => null, // Response body. |
|
33
|
|
|
'httpCode' => null, // HTTP response code. |
|
34
|
|
|
'runtime' => null, // Request execution time. |
|
35
|
|
|
'httpHeaderList' => null, // Header list. |
|
36
|
|
|
'httpCookieList' => null, // Cookie list. |
|
37
|
|
|
); |
|
38
|
|
|
} |
|
39
|
|
|
|