protected function performRequest(
        $path = '/',
        $query = array(),
        $httpVerb = 'GET',
        $headers = array(),
        $forTableStorage = false,
        $rawData = null,
        $resourceType = self::RESOURCE_UNKNOWN,
        $requiredPermission = self::PERMISSION_READ
    ) {
        // Clean path
        if (strpos($path, '/') !== 0) {
            $path = '/' . $path;
        }

        if (!isset($headers['Content-Type'])) {
            $headers['Content-Type'] = '';
        }

        if (!isset($headers['content-length']) && ($rawData !== null || $httpVerb == "PUT")) {
            $headers['Content-Length'] = strlen((string)$rawData);
        }
        $headers['Expect'] = '';

        // Add version header
        $headers['x-ms-version'] = $this->apiVersion;

        // Generate URL
        $path = str_replace(' ', '%20', $path);
        $requestUrl = $this->getBaseUrl() . $path;
        if (count($query) > 0) {
            $queryString = '';
            foreach ($query as $key => $value) {
                $queryString .= ($queryString ? '&' : '?') . rawurlencode($key) . '=' . rawurlencode($value);
            }
            $requestUrl .= $queryString;
        }

        $requestUrl = $this->credentials->signRequestUrl($requestUrl, $resourceType, $requiredPermission);
        $headers    = $this->credentials->signRequestHeaders(
            $httpVerb,
            $path,
            $query,
            $headers,
            $forTableStorage,
            $resourceType,
            $requiredPermission,
            $rawData
        );

        return $this->httpClient->request($httpVerb, $requestUrl, $rawData, $headers);
    }