1 | <?php |
||
12 | final class HttpMethodsClient implements HttpMethodsClientInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var ClientInterface |
||
16 | */ |
||
17 | private $httpClient; |
||
18 | |||
19 | /** |
||
20 | * @var RequestFactory |
||
21 | */ |
||
22 | private $requestFactory; |
||
23 | |||
24 | /** |
||
25 | * @param ClientInterface $httpClient The client to send requests with |
||
26 | * @param RequestFactory $requestFactory The message factory to create requests |
||
27 | */ |
||
28 | 8 | public function __construct(ClientInterface $httpClient, RequestFactory $requestFactory) |
|
33 | |||
34 | 1 | public function get($uri, array $headers = []): ResponseInterface |
|
38 | |||
39 | 1 | public function head($uri, array $headers = []): ResponseInterface |
|
43 | |||
44 | 1 | public function trace($uri, array $headers = []): ResponseInterface |
|
48 | |||
49 | 1 | public function post($uri, array $headers = [], $body = null): ResponseInterface |
|
53 | |||
54 | 1 | public function put($uri, array $headers = [], $body = null): ResponseInterface |
|
58 | |||
59 | 1 | public function patch($uri, array $headers = [], $body = null): ResponseInterface |
|
63 | |||
64 | 1 | public function delete($uri, array $headers = [], $body = null): ResponseInterface |
|
68 | |||
69 | 1 | public function options($uri, array $headers = [], $body = null): ResponseInterface |
|
73 | |||
74 | 8 | public function send($method, $uri, array $headers = [], $body = null): ResponseInterface |
|
83 | |||
84 | 8 | public function sendRequest(RequestInterface $request): ResponseInterface |
|
88 | } |
||
89 |