LeagueWrap\Client::request PHP Method

request() public method

Attempts to do a request of the given path.
public request ( string $path, array $params = [] ) : Response
$path string
$params array
return Response
    public function request($path, array $params = [])
    {
        if (!$this->guzzle instanceof Guzzle) {
            throw new BaseUrlException('BaseUrl was never set. Please call baseUrl($url).');
        }
        $uri = $path . '?' . http_build_query($params);
        $response = $this->guzzle->get($uri, ['timeout' => $this->timeout, 'http_errors' => false]);
        $body = $response->getBody();
        $code = $response->getStatusCode();
        $headers = $response->getHeaders();
        if ($body instanceof Stream) {
            $body->seek(0);
            $content = $body->getSize() > 0 ? $body->read($body->getSize()) : null;
        } else {
            // no content
            $content = '';
        }
        $response = new Response($content, $code, $headers);
        return $response;
    }