Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. use GuzzleHttpClient;
  2. use GuzzleHttpExceptionConnectException;
  3. try {
  4. $client = new Client();
  5. $response = $client->request('GET', $url); //it crashes at this line
  6. $content = json_decode($response->getBody(), true);
  7.  
  8. }
  9. catch (ConnectException $e) {
  10. Drupal::logger('amu_hal')->error('incorrect_url'.$url);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement