Make calls to WS

@param string $url
@param string $method
@return boolean if no result or string if succes
@throws \Exception if navitia call fail
510233
private function call($url, $method = 'GET')
    {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_NOSIGNAL, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
        //Timeout in 5s
        curl_setopt($ch, CURLOPT_TIMEOUT_MS, $this->timeout);
        $response = curl_exec($ch);
        $errorMsg = curl_error($ch);
        $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        curl_close($ch);
        if ($httpCode !== 200) {
            $response = json_decode($response);
            if (isset($response->error)) {
                $errorMsg .= '(' . $response->error . ')';
            }

            throw new \Exception($httpCode . ' : ' . $errorMsg);
        }

        if ($response === false) {
            return false;
        }

        return $response;
    }
1250219
protected function request($method, $url, $request)
    {
        $response = (new Client)->$method($url, $request);

        if ($response->getStatusCode() !== 200) {
            $error = $this->parseError($response->getStatusCode());

            $this->log('Error Received: '.$error, [
                'code' => $response->getStatusCode(),
                'body' => $response->getBody(),
            ]);

            throw new PebbleApiException(
                $error,
                $response->getStatusCode(),
                $response->getBody(),
                isset($request['json']) ? $request['json'] : null
            );
        }
    }
309537
private function methodAllowsQueryString(string $method): bool
    {
        return (Http::GET === $method || Http::HEAD === $method);
    }
489614
private function method($url, $closure, $method) {
			
		if(false === is_string($url)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($url)), E_USER_ERROR);
		}

		if(false === is_string($method)) {
			return trigger_error(sprintf('Argument 3 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($method)), E_USER_ERROR);
		}

		$this -> method = $method;
		$this -> url 	= new URLParser($url);
		$this -> options[CURLOPT_CUSTOMREQUEST] = strtoupper($method);

		if(is_object($closure)) {
			call_user_func($closure, $this);
		}

		$this -> send();

		return $this;
	}
450658
public static function invokeSoap($wsdlURL, $method,
                                      array $params = array(),
                                      array $options = array())
    {
        try {
            $soapClient = new \SoapClient($wsdlURL, $options);
            $result     = $soapClient->$method($params);
        } catch (\SoapFault $ex) {
            $result = false;
        }
        return $result;
    }
1353934
public function matches($url, $method)
    {
        if ($this->httpmethod !== 'ANY' && strtolower($method) !== strtolower($this->httpmethod)) {
            return false;
        }

        // Exact match OR pattern match
        return $this->pattern == $url || $this->patternMatch($url);
    }
85368
protected function callSoapMethod($method)
    {
        $args = func_get_args();
        array_shift($args);

        LogHandler::log($args, LoggerInterface::LEVEL_INFO, 'request_object');

        try {
            $response = call_user_func_array([$this->getSoapClient(), $method], $args);
            LogHandler::log($response, LoggerInterface::LEVEL_INFO, 'response_object');
        } catch (\SoapFault $e) {
            LogHandler::log(
                'SOAP ERROR (' . $e->faultcode . '): ' . $e->getMessage(),
                LoggerInterface::LEVEL_ERROR,
                'error'
            );
            throw new \SoapFault($e->faultcode, $e->faultstring);
        }

        $this->validateResponseCertificate();

        LogHandler::log(
            "Response certificate validated successfully",
            LoggerInterface::LEVEL_INFO,
            'response_certificate_validated'
        );

        return $response;
    }
142506
private function processRequest($url, $headers, $method = 'post')
    {
        if (array_key_exists('body', $headers)) {
            $headers['body'] = json_encode($headers['body']);
        }

        if ($method == 'post') {
            $response = $this->guzzle->request('POST', $url, $headers);
        } elseif ($method == 'delete') {
            $response = $this->guzzle->request('DELETE', $url, $headers);
        } else {
            $params = $this->processGetParams($headers);
            $response = $this->guzzle->request('GET', $url . $params);
        }
        $response = $this->processResponse($response);

        return $response;
    }
171743
public function createRequest($method, $url = '', array $headers = [])
    {
        return $this->client->createRequest($method, $url, $headers);
    }
602437
public function callAction($method, $parameters)
    {
        $route = app('router')->current();
        $request = app('request');
        $this->assignAfter($route, $request, $method);
        $response = $this->before($route, $request, $method);

        if (is_null($response)) {
            $response = call_user_func_array([$this, $method], $parameters);
        }

        return $response;
    }
133843
protected function query($method, $url, array $parameters = null)
    {
        return $this->httpClient->query($method, $url, $parameters);
    }
809097
private function requestHub($method, $uri, $options)
    {
        try {
            if ($this->getAsync()) {
                return $this->client->requestAsync($method, $uri, $options);
            }

            return $this->client->request($method, $uri, $options);
        } catch (ConnectException $e) {
            if ($options['retries'] > 0) {
                --$options['retries'];

                return $this->requestHub($method, $uri, $options);
            }

            throw new ConnectException($e->getMessage(), $e->getRequest(), null, $e->getHandlerContext());
        }
    }
1015977
public function call($method, array $params = array())
    {
        $params = array($this->getSession(), $method, $params);
        return $this->getClient()->call('call', $params);
    }
510489
protected function sendRequest(string $method = 'PURGE', string $uri, array $headers = [])
    {
        $client = new Client([
            'base_uri' => self::API_ENDPOINT,
            'headers'  => array_merge($headers, [
                'Content-Type' => 'application/json',
                'Fastly-Key'   => $this->apiToken
            ])
        ]);

        // Prepend the service endpoint
        if (in_array($method, ['POST','GET'])) {
            $uri = "service/{$this->serviceId}/{$uri}";
        }

        try {

            $client->request($method, $uri);

        } catch (BadResponseException $e) {

            throw FastlyApiException::create(
                $e->getRequest(),
                $e->getResponse()
            );
        }

        return true;
    }
1128559
public function send(string $method, string $url, array $options)
    {
        try {
            // Guzzle overwrites all query string values in the URI if queries are specified
            // in the 'query' option, so they need to be extracted first.
            $optionsPayload = $this->mergeOptions(
                ['query' => $this->parseQueryParams($url)],
                $options
            );

            $response = $this->buildClient()->request($method, $url, $optionsPayload);

            return $this->buildResponse($response);
        } catch (GuzzleException $exception) {
            // No "custom" exceptions, just rethrow whatever guzzle spits out.
            throw $exception;
        }
    }
346183
public function requestRaw(string $url, string $method = 'GET', array $options = [])
    {
        return Response::buildFromPsrResponse($this->request($url, $method, $options, true));
    }
1126903
public function run($url = null, $method = null)
    {
        $route = $this->altoRouter->match($url, $method);
        if (!$route) {
            throw new NotFoundException(((isset($_SERVER['REQUEST_URI']) && !empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : (($url != null) ? $url : "/")) . " is not reachable.");
        }
        if (!isset($route['target']['c']) || !isset($route['target']['a']) || !isset($route['params'])) {
            throw new FrameworkException('Internal Framework Error. [!BAD_ROUTER_TARGET]', 001);
        }
        if (is_callable(array($route['target']['c'], 'getInstance'))) {
            $controller = $route['target']['c']::getInstance();
            if (method_exists($controller, $route['target']['a'])) {
                call_user_func(array($controller, $route['target']['a']), array_values($route['params']));
                $controller->response->send();
            } else {
                throw new FrameworkException('Internal Framework Error. [METHOD_DOES_NOT_EXISTS]', 002);
            }
        } else {
            throw new FrameworkException('Internal Framework Error. [CONTROLLER_DOES_NOT_EXISTS]', 003);
        }
    }