1 | <?php |
||
17 | class DropboxGuzzleHttpClient implements DropboxHttpClientInterface |
||
18 | { |
||
19 | /** |
||
20 | * GuzzleHttp client. |
||
21 | * |
||
22 | * @var \GuzzleHttp\Client |
||
23 | */ |
||
24 | protected $client; |
||
25 | |||
26 | /** |
||
27 | * Create a new DropboxGuzzleHttpClient instance. |
||
28 | * |
||
29 | * @param Client $client GuzzleHttp Client |
||
30 | */ |
||
31 | 3 | public function __construct(Client $client = null) |
|
36 | |||
37 | /** |
||
38 | * Send request to the server and fetch the raw response. |
||
39 | * |
||
40 | * @param string $url URL/Endpoint to send the request to |
||
41 | * @param string $method Request Method |
||
42 | * @param string|resource|StreamInterface $body Request Body |
||
43 | * @param array $headers Request Headers |
||
44 | * @param array $options Additional Options |
||
45 | * |
||
46 | * @return \Kunnu\Dropbox\Http\DropboxRawResponse Raw response from the server |
||
47 | * |
||
48 | * @throws \Kunnu\Dropbox\Exceptions\DropboxClientException |
||
49 | */ |
||
50 | 2 | public function send($url, $method, $body, $headers = [], $options = []) |
|
87 | |||
88 | /** |
||
89 | * Get the Response Body. |
||
90 | * |
||
91 | * @param string|\Psr\Http\Message\ResponseInterface $response Response object |
||
92 | * |
||
93 | * @return string |
||
94 | */ |
||
95 | 2 | protected function getResponseBody($response) |
|
111 | } |
||
112 |