public function request(string $method, string $uri, $body, array $headers = [], array $options = []) {
        $request = $this->createRequest($method, $uri, $body, $headers, $options);
        // Call the chain of middleware on the request.
        $response = call_user_func($this->middleware, $request);

        if (!$response->isResponseClass('2xx')) {
            $this->handleErrorResponse($response, $options);
        }

        return $response;
    }