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