public function sendRequest(Request $request): Response {
        if ($this->txUrl && time() - $this->txTimestamp > $this->txKeepAlive) {
            $this->prolong();
        }
        try {
            $response = $this->client->send($request);

            // Fedora triplestore plugin doesn't index resources which were
            // deleted and recreated within the same transaction so we need
            // to remember deleted resources and try to reindex them at the end
            // of a transaction.
            if ($request->getMethod() === 'DELETE') {
                $this->resToReindex[] = preg_replace('|/fcr:[-a-zA-Z0-9]+$|', '', $request->getUri());
            }
        } catch (RequestException $e) {
            switch ($e->getCode()) {
                case 410:
                    throw new Deleted();
                case 404:
                    throw new NotFound();
                default:
                    throw $e;
            }
        }
        return $response;
    }