public function request(string $method, $uri, array $options = []): HttpResultInterface
    {
        $options = $this->prepareDefaults($options);
        $headers = $options['headers'] ?? [];
        $body = $options['body'] ?? null;
        $version = $options['version'] ?? '1.1';
        // Merge the URI into the base URI.
        $uri = $this->buildUri($uri, $options);
        $profileKey = 'http.' . (string)$uri;
        App::profileStart($profileKey);
        $request = new Request($method, $uri, $headers, $body, $version);
        $adapter = $this->getAdapter();
        $this->setDefaultUserAgent();
        $result = $adapter->request($request, $options);
        App::profileEnd($profileKey);
        return $result;
    }