1 | <?php |
||
7 | class Client |
||
8 | { |
||
9 | protected $handler; |
||
10 | |||
11 | public function __construct(ClientInterface $handler) |
||
15 | |||
16 | /** |
||
17 | * Shortcut to make a GET request |
||
18 | * |
||
19 | * @return array|string |
||
20 | */ |
||
21 | public function get($path, array $options = [], $withJson = true) |
||
25 | |||
26 | /** |
||
27 | * Shortcut to make a PUT request |
||
28 | * |
||
29 | * @return array |
||
30 | */ |
||
31 | public function put($path, array $options = []) |
||
35 | |||
36 | /** |
||
37 | * Shortcut to make a DELETE request |
||
38 | * |
||
39 | * @return boolean |
||
40 | */ |
||
41 | public function delete($path, array $options = []) |
||
47 | |||
48 | /** |
||
49 | * Shortcut to make a POST request |
||
50 | * |
||
51 | * @return array |
||
52 | */ |
||
53 | public function post($path, array $options = []) |
||
57 | |||
58 | /** |
||
59 | * Make the HTTP request through the handler |
||
60 | * |
||
61 | * @return array|string |
||
62 | */ |
||
63 | public function sendRequest($method, $path, array $options = [], $withJson = true) |
||
71 | } |
||
72 |