| @@ 286-299 (lines=14) @@ | ||
| 283 | * |
|
| 284 | * @return \GuzzleHttp\Message\Response|false The response or false if failed. |
|
| 285 | */ |
|
| 286 | protected function get($path) |
|
| 287 | { |
|
| 288 | try { |
|
| 289 | $response = $this->client->get($this->base . $path); |
|
| 290 | } catch (ClientException $e) { |
|
| 291 | return false; |
|
| 292 | } |
|
| 293 | ||
| 294 | if ($response->getStatusCode() !== 200) { |
|
| 295 | return false; |
|
| 296 | } |
|
| 297 | ||
| 298 | return $response; |
|
| 299 | } |
|
| 300 | ||
| 301 | /** |
|
| 302 | * Performs a HEAD request. |
|
| @@ 308-321 (lines=14) @@ | ||
| 305 | * |
|
| 306 | * @return \GuzzleHttp\Message\Response|false The response or false if failed. |
|
| 307 | */ |
|
| 308 | protected function head($path) |
|
| 309 | { |
|
| 310 | try { |
|
| 311 | $response = $this->client->head($this->base . $path); |
|
| 312 | } catch (ClientException $e) { |
|
| 313 | return false; |
|
| 314 | } |
|
| 315 | ||
| 316 | if ($response->getStatusCode() !== 200) { |
|
| 317 | return false; |
|
| 318 | } |
|
| 319 | ||
| 320 | return $response; |
|
| 321 | } |
|
| 322 | } |
|
| 323 | ||