Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use GuzzleHttpClient;
- use GuzzleHttpExceptionConnectException;
- try {
- $client = new Client();
- $response = $client->request('GET', $url); //it crashes at this line
- $content = json_decode($response->getBody(), true);
- }
- catch (ConnectException $e) {
- Drupal::logger('amu_hal')->error('incorrect_url'.$url);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement