public function request(string $url, array $requestHeaders = [], $returnResponseHeaders = false)
    {
        $handle = $this->createCurlHandle($url);

        if ($proxy = Config::get('hpProxy')) {
            $handle->setOption(CURLOPT_PROXY, $proxy);
        }

        if (!empty($requestHeaders)) {
            $handle->setOption(CURLOPT_HTTPHEADER, $this->prepareHeaders($requestHeaders));
        }

        if ($returnResponseHeaders) {
            $handle->setOption(CURLOPT_HEADER, true);
        }

        $response = $handle->execute();
        $statusCode = $handle->getInfo(CURLINFO_HTTP_CODE);
        $handle->close();

        if ($response && $returnResponseHeaders) {
            return $this->splitResponseHeaderAndBody($response, $statusCode);
        }

        return $response;
    }