1 | <?php declare(strict_types=1); |
||
29 | class Client implements HttpRequestInterface |
||
30 | { |
||
31 | |||
32 | /** |
||
33 | * Client variable |
||
34 | * @var \GuzzleHttp\ClientInterface |
||
35 | */ |
||
36 | protected $guzzleClient; |
||
37 | |||
38 | /** |
||
39 | * Constructor |
||
40 | * @param \GuzzleHttp\ClientInterface $guzzleClient |
||
41 | */ |
||
42 | 353 | public function __construct(\GuzzleHttp\ClientInterface $guzzleClient) |
|
46 | |||
47 | /** |
||
48 | * Send response method from specific http method |
||
49 | * @param string $method Http method (GET, POST, DELETE) |
||
50 | * @param string $url |
||
51 | * @param array $options |
||
52 | * @param array $form_params |
||
53 | * @return mixed |
||
54 | */ |
||
55 | 12 | private function sendResponse(string $method, string $url, array $options = [], array $form_params = array()) |
|
76 | |||
77 | /** |
||
78 | * Get response method |
||
79 | * @param string $url |
||
80 | * @return mixed |
||
81 | */ |
||
82 | 4 | public function getResponse(string $url) |
|
86 | |||
87 | /** |
||
88 | * Post response method |
||
89 | * @param string $url |
||
90 | * @param array $options |
||
91 | * @param array $form_params |
||
92 | * @return mixed |
||
93 | */ |
||
94 | 4 | public function postResponse(string $url, array $options = [], array $form_params = array()) |
|
98 | |||
99 | /** |
||
100 | * Delete response method |
||
101 | * @param string $url |
||
102 | * @return mixed |
||
103 | */ |
||
104 | 4 | public function deleteResponse(string $url) |
|
108 | } |
||
109 |