Kelunik\Acme\AcmeClient::doGet PHP Method

doGet() private method

Retrieves a resource using a GET request.
private doGet ( string $resource ) : Generator
$resource string resource to fetch
return Generator coroutine resolved by Amp returning the HTTP response
    private function doGet($resource)
    {
        if (!is_string($resource)) {
            throw new InvalidArgumentException(sprintf("\$resource must be of type string, %s given.", gettype($resource)));
        }
        $uri = (yield $this->getResourceUri($resource));
        try {
            $response = (yield $this->http->request($uri));
            $this->saveNonce($response);
        } catch (Throwable $e) {
            throw new AcmeException("GET request to {$uri} failed: " . $e->getMessage(), null, $e);
        } catch (Exception $e) {
            throw new AcmeException("GET request to {$uri} failed: " . $e->getMessage(), null, $e);
        }
        (yield new CoroutineResult($response));
    }