We override this function from parent to use cURL.

@param string $request
@param string $location
@param string $action
@param int $version
@param int $one_way
@return string
@author Peter Haza
489438
public function __doRequest($request, $location, $action, $version, $one_way = 0) {

		$this->__last_request = $request;

		if(empty($this->headers)) {
			$headers = array( 'Connection: Close', 'Content-Type: application/soap+xml' );
		}
		else {
			$headers = $this->headers;
		}

		$soapHeaders = array(
			sprintf('SOAPAction: "%s"', $action),
			sprintf('Content-Length: %d', strlen($request))
		);

		$headers = array_merge($headers, $soapHeaders);

		$this->logger->debug('Request: '.$request, $headers);

		$ch = curl_init($location);

		$options = $this->curlOptions + array(
			CURLOPT_FOLLOWLOCATION => true,
			CURLOPT_SSL_VERIFYHOST => 2,
			CURLOPT_SSL_VERIFYPEER => true,
			CURLOPT_RETURNTRANSFER => true,
			CURLOPT_HTTPHEADER     => $headers,
			CURLOPT_POSTFIELDS     => $request
		);

		if($this->logger->isHandling(Logger::DEBUG)) {
			$tmp = fopen('php://temp', 'r+');
			$options[CURLOPT_VERBOSE] = true;
			$options[CURLOPT_STDERR]  = $tmp;
		}

		curl_setopt_array($ch, $options);

		$output = curl_exec($ch);

		if(isset($tmp) && is_resource($tmp)) {
			rewind($tmp);
			$this->logger->debug(stream_get_contents($tmp));
			fclose($tmp);
		}

		$this->logger->debug('Response: '.$output);

		return $output;
	}
1336629
final protected function getRedirectResponse($location, $addSuffix = true)
    {
        $url = $this->request()->getAppUrl();
        $url .= $location;
        if ($addSuffix) {
            $url .= $this->request()->getSuffix();
        }
        return $this->getRedirectUrlResponse($url);
    }
390839
private function postData($action)
    {
        $xml = $this->xml->__toString();
        $xml = str_replace('<?xml version="1.0" encoding="UTF-8"?>', null, $xml);
        $xml = str_replace("\n", null, $xml);
        $digest = $this->calculateDigest($xml);
        $xml .= '<Digest>'.$digest.'</Digest>';
        $content = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><VPOS xmlns="http://www.modirum.com/schemas">%s</VPOS>';

        return sprintf($content, $xml);
    }
798271
public static function request($method, $url, $payload = [], $curlOptions = [])
    {
        return static::_httpRequest($method, $url, $payload, $curlOptions);
    }
1187462
public function resolveRequest(Request $request, $action = null)
    {
        $this->setDirPath($request->get('dir_path'));

        $this->setCurrentFile($this->getPath($this->getDirPath(), $request->get('filename'), true));

        if ($action === self::FILE_RENAME && !$this->getCurrentFile()->isDir()) {
            $extension = $this->getCurrentFile()->getExtension();
            $target_file = $request->get('target_file') . "." . $extension;
        } elseif ($action === self::FILE_PASTE) {

            $sources = $this->container->get('session')->get('copy');
            $this->setCurrentFile($sources['source_dir'] . FileManager::DS . $sources['source_file']);
            $target_file = $request->get('target_file') . FileManager::DS . $sources['source_file'];
        } else {
            $target_file = $request->get('target_file');
        }

        if (isset($target_file)) {
            $this->setTargetFile($target_file);
        }
    }
346550
public function moveAction(Request $request)
    {
        $admin = $this->getAdmin();

        $admin->checkAccess('edit');

        if ($admin->isChild()) {
            $id = $request->query->get('childId');
        } else {
            $id = $request->query->get('id');
        }

        $targetId = $request->query->get('target');
        $dropPosition = $request->query->get('position');

        $em = $this->getDoctrine()->getManager();

        /** @var NestedTreeRepository $repo */
        $repo = $em->getRepository($admin->getClass());

        $currentNode = $repo->find($id);
        $targetNode = $repo->find($targetId);

        switch ($dropPosition) {
            case 'before':
                $currentNode->setParent($targetNode->getParent());

                if ($targetNode->getPosition()) {
                    $currentNode->setPosition($targetNode->getPosition() - 1);
                } else {
                    $currentNode->setPosition(0);
                }
                break;
            case 'after':
                $currentNode->setParent($targetNode->getParent());
                $currentNode->setPosition($targetNode->getPosition() + 1);
                break;
            case 'append':
                $currentNode->setParent($targetNode);
                $currentNode->setPosition(-1);
                break;
        }

        $admin->update($currentNode);
        $admin->update($targetNode);

        return $this->renderJson(['result' => true]);
    }
198845
private function api_request( $_action = '', $_data = '' ) {
		$update_data = $this->get_version_data();
		if ( empty( $update_data ) ) {
			return false;
		}
		if ( $update_data && isset( $update_data->sections ) ) {
			$update_data->sections = maybe_unserialize( $update_data->sections );
		}

		return $update_data;
	}
257103
protected function getRqlUrl(Request $request, $url)
    {
        if ($request->attributes->get('hasRql', false)) {
            $rawRql = $request->attributes->get('rawRql');

            $url = str_replace(urlencode($rawRql), str_replace(',', '%2C', $rawRql), $url);
        }
        return $url;
    }
576069
public function __doRequest($request, $location, $action, $version, $oneWay = null)
    {
        $this->requestId = substr(str_replace(' ', '', microtime()), 2);

        $response = parent::__doRequest($request, $location, $action, $version, $oneWay);

        if (!empty($response)) {
            $xml = new \SimpleXMLElement($response);
            $nss = array_flip($xml->getDocNamespaces(true));
            $invalidNs = 'http://namespaces.soaplite.com/perl';

            if (isset($nss[$invalidNs]) && isset($nss['API'])) {
                $response = str_replace($nss[$invalidNs] . ':', $nss['API'] . ':', $response);
            }
        }

        return $response;
    }
1243189
public function doRequest($request, $location, $action, $version, $one_way = 0, $options = array())
    {
        if ($this->status === self::DISABLED) {
            throw new VCRException('Hook must be enabled.', VCRException::LIBRARY_HOOK_DISABLED);
        }

        $vcrRequest = new Request('POST', $location);

        if ($version === SOAP_1_1) {
            $vcrRequest->setHeader('Content-Type', 'text/xml; charset=utf-8;');
            $vcrRequest->setHeader('SOAPAction', $action);
        } else { // >= SOAP_1_2
            $vcrRequest->setHeader(
                'Content-Type',
                sprintf('application/soap+xml; charset=utf-8; action="%s"', $action)
            );
        }

        $vcrRequest->setBody($request);

        if (!empty($options['login'])) {
            $vcrRequest->setAuthorization($options['login'], $options['password']);
        }

        /* @var \VCR\Response $response */
        $requestCallback = self::$requestCallback;
        $response = $requestCallback($vcrRequest);

        return $response->getBody();
    }
1341843
private function execute($method, $action, $request = null)
    {
        $url =  "{$this->url}$action." . self::$FORMAT;
        $headers = ['Authorization: BASIC '. base64_encode(
            $this->key . ':xxx'
        )];
        $request = $this->request
                        ->setAction($action)
                        ->getParameters($method, $request);
        $ch = static::initCurl($method, $url, $request, $headers);
        $i = 0;
        while ($i < 5) {
            $data        = curl_exec($ch);
            $status      = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
            $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
            $headers     = $this->parseHeaders(substr($data, 0, $header_size));
            if ($status === 400 &&
                                (int) $headers['X-RateLimit-Remaining'] === 0) {
                $i ++;
                sleep(10);
            } else {
                break;
            }
        }
        // echo $data, PHP_EOL, PHP_EOL;
        $body        = substr($data, $header_size);
        $errorInfo   = curl_error($ch);
        $error       = curl_errno($ch);
        curl_close($ch);
        if ($error) {
            throw new Exception($errorInfo);
        }

        $headers['Status'] = $status;
        $headers['Method'] = $method;
        $headers['X-Url']  = $url;
        $headers['X-Request'] = $request;
        $headers['X-Action']  = $action;
        // for chrome use
        $headers['X-Authorization'] = 'BASIC '. base64_encode($this->key . ':xxx');
        $response = '\\TeamWorkPm\\Response\\' . strtoupper(self::$FORMAT);
        $response = new $response;

        return $response->parse($body, $headers);
    }
941449
public function viewParentExtraInfoAction(Location $location)
    {
        $repository = $this->getRepository();
        $parentLocation = $repository->getLocationService()->loadLocation($location->parentLocationId);

        // TODO once the keyword service is available replace part this subrequest by a full symfony one

        return $this->render(
            'eZDemoBundle:parts/blog:extra_info.html.twig',
            array('location' => $parentLocation)
        );
    }
1176443
public function doRequest($endpoint, $version = null)
    {
        if ($version === null) {
            $version = $this->version;
        }

        $auth = $this->getAuth();
        $data = $this->getData();
        $uri = Config::getApiUrl($endpoint, (int) $version);

        /** @var Curl $curl */
        $curl = Config::getCurl();

        if (Config::getCAInfoLocation()) {
            // set a custom CAInfo file
            $curl->setOpt(CURLOPT_CAINFO, Config::getCAInfoLocation());
        }

        if (!empty($auth)) {
            $curl->setBasicAuthentication($auth['username'], $auth['password']);
        }


        $curl->setOpt(CURLOPT_SSL_VERIFYPEER, Config::getVerifyPeer());

        $result = $curl->post($uri, $data);

        if (isset($result->status) && $result->status === 'FALSE') {
            throw new Error\Api($result->error);
        }

        if ($curl->error) {
            throw new Error\Error($curl->errorMessage);
        }

        return $this->processResult($result);
    }
553604
public function put($location, $body)
    {
        curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, 'PUT');
        curl_setopt($this->curl, CURLOPT_POSTFIELDS, $body);
        curl_setopt($this->curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));

        return $this->execute('PUT', $location);
    }
1179266
public function urlAction($action, array $query = [])
    {
        $query['action'] = $action;
        $query = array_replace($this->query(), $query);

        return $this->url() . '?' . http_build_query($query);
    }
789903
private function api_request( $_action ) {

		$geot_api_request_transient = $this->get_cached_version_info( $this->cache_key );

		if ( ! empty( $geot_api_request_transient ) ) {
			return $geot_api_request_transient;
		}

		$api_params = array(
			'slug' => $this->slug,
		);
		$url        = add_query_arg( $api_params, $this->api_url . $_action );

		$request = wp_remote_get( $url, array( 'timeout' => 15 ) );

		if ( is_wp_error( $request ) || isset( $request->error ) ) {
			return;
		}
		$request = json_decode( wp_remote_retrieve_body( $request ) );

		$data = $this->parseRequest( $request );
		$this->set_version_info_cache( $data );

		return $data;
	}
1298769
public function getCurrentUri(Action $action, Request $request, array $parameters = []): string
    {
        if ($request->attributes->get('_route') === $action->getRouteName()) {
            $parameters = array_merge(
                $request->attributes->get('_route_params'),
                $parameters
            );
        }

        return $this->adminRouter->generateAdminPath($action->getAdmin(), $action->getCode(), $parameters);
    }