2, // wait two seconds by default ], $opts); $client = new Client(); $response = $client->request('GET', $uri, $opts); $body = $response->getBody()->getContents(); if ($response->getHeader('content-type') === 'application/json') { $body = \GuzzleHttp\json_decode($body); } return $body; } }