private function requestResource($actionPath, $params = [], $method = 'GET')
    {
        $url = $this->getApiUrl() . $actionPath;

        $cookies = CookieJar::fromArray([
            'PVEAuthCookie' => $this->authToken->getTicket(),
        ], $this->credentials->getHostname());

        switch ($method) {
            case 'GET':
                return $this->httpClient->get($url, [
                    'verify' => false,
                    'exceptions' => false,
                    'cookies' => $cookies,
                    'query' => $params,
                ]);
            case 'POST':
            case 'PUT':
            case 'DELETE':
                $headers = [
                    'CSRFPreventionToken' => $this->authToken->getCsrf(),
                ];
                return $this->httpClient->request($method, $url, [
                    'verify' => false,
                    'exceptions' => false,
                    'cookies' => $cookies,
                    'headers' => $headers,
                    'form_params' => $params,
                ]);
            default:
                $errorMessage = "HTTP Request method {$method} not allowed.";
                throw new \InvalidArgumentException($errorMessage);
        }
    }