protected function getOaiResponse($verb, $params)
    {
        // Debug:
        $this->write(
            "Sending request: verb = {$verb}, params = " . print_r($params, true)
        );

        // Set up retry loop:
        do {
            $result = $this->sendRequest($verb, $params);
            if ($result->getStatusCode() == 503) {
                $delayHeader = $result->getHeaders()->get('Retry-After');
                $delay = is_object($delayHeader)
                    ? $delayHeader->getDeltaSeconds() : 0;
                if ($delay > 0) {
                    $this->writeLine(
                        "Received 503 response; waiting {$delay} seconds..."
                    );
                    sleep($delay);
                }
            } elseif (!$result->isSuccess()) {
                throw new \Exception('HTTP Error ' . $result->getStatusCode());
            }
        } while ($result->getStatusCode() == 503);

        // If we got this far, there was no error -- send back response.
        return $result->getBody();
    }