|
@@ 33-41 (lines=9) @@
|
| 30 |
|
]); |
| 31 |
|
} |
| 32 |
|
|
| 33 |
|
public function get(string $url, array $parameters) : array |
| 34 |
|
{ |
| 35 |
|
$response = $this->client->get($url, ['query' => $parameters]); |
| 36 |
|
if (!$response instanceof ResponseInterface) { |
| 37 |
|
throw new ResponseIsNotValidInstance(); |
| 38 |
|
} |
| 39 |
|
|
| 40 |
|
return json_decode($response->getBody()->getContents(), true); |
| 41 |
|
} |
| 42 |
|
|
| 43 |
|
public function post(string $url, array $parameters) : array |
| 44 |
|
{ |
|
@@ 58-66 (lines=9) @@
|
| 55 |
|
return $this->internalPost($url, $parameters); |
| 56 |
|
} |
| 57 |
|
|
| 58 |
|
private function internalPost(string $url, array $parameters) |
| 59 |
|
{ |
| 60 |
|
$response = $this->client->post($url, ['form_params' => $parameters]); |
| 61 |
|
if (!$response instanceof ResponseInterface) { |
| 62 |
|
throw new ResponseIsNotValidInstance(); |
| 63 |
|
} |
| 64 |
|
|
| 65 |
|
return json_decode($response->getBody()->getContents(), true); |
| 66 |
|
} |
| 67 |
|
} |
| 68 |
|
|