Sends request by given type, uri and options
@param PDFfiller $provider
@param $method
@param $uri
@param array $params
@return mixed
@throws InvalidRequestException
182931
protected static function apiCall($provider, $method, $uri, $params = [])
    {
        $methodName = $method . 'ApiCall';
        if (method_exists($provider, $methodName)) {
            return $provider->{$methodName}($uri, $params);
        }
        throw new InvalidRequestException();
    }
375417
public function sendRequest($url, $params, $method)
    {
        try{
            if (!empty($params['html'])){
                $commandName = 'GenerateFromHTML';
            }
            else if (!empty($params['url'])){
                $commandName = 'GenerateFromURL';
            }
            else if (!empty($params['file'])&& $url=='pdf'){
                $commandName = 'GenerateFromFile';
            }
            else {
                $operations = $this->getDescription()->getOperations();
                foreach ($operations as $operation)
                {
                    if ($operation->getUri()==$url && $operation->getHttpMethod() == $method)
                    {
                        $commandName = $operation->getName();
                    }
                }
            }
            $command = $this->getCommand($commandName, $params);
            $ret = $this->execute($command);

            if ( $commandName == 'GetAssetList' || $commandName == 'UploadAsset' )
            {
                return json_encode($ret);
            }
            return $ret->getBody(true);

        }catch(ClientErrorResponseException $exception){
            throw new \Exception($exception->getResponse()->getBody(true), $exception->getResponse()->getStatusCode());
        }
    }
100611
public function createRequest($method = 'GET', $uri = null, $headers = null, $body = null, array $options = array())
    {
        $uri = '{+base_path}/' . ltrim($uri, '/');
        return parent::createRequest($method, $uri, $headers, $body, $options);
    }
600083
public function createServerRequest(string $method, $uri, array $serverParams = []): ServerRequestInterface
  {
    # Copied from Guzzles ::fromGlobals(), but we need to support the $server array as
    # paramter, so we use that instead of the $_SERVER array guzzle uses by default

    $method = isset($server['REQUEST_METHOD']) ? $server['REQUEST_METHOD'] : 'GET';
    $headers = \function_exists('getallheaders') ? \getallheaders() : [];
    $uri = $uri;
    $body = new LazyOpenStream('php://input', 'r+');
    $protocol = isset($server['SERVER_PROTOCOL']) ? \str_replace('HTTP/', '', $server['SERVER_PROTOCOL']) : '1.1';

    $serverRequest = new ServerRequest($method, $uri, $headers, $body, $protocol, $server);

    \logger()->debug('Created PSR-7 ServerRequest("'.$method.'","'.$url.'") (Guzzle)');

    return $serverRequest
        ->withCookieParams($_COOKIE)
        ->withQueryParams($_GET)
        ->withParsedBody($_POST)
        ->withUploadedFiles(ServerRequest::normalizeFiles($_FILES));
  }
1286517
public function request($method, $uri, $options = [])
    {
        if ($this->authorization !== null) {
            $authHeader = sprintf('%s %s', $this->authorization->getAuthType(), $this->authorization->getCredentials());
            $headers = isset($options['headers']) ? $options['headers'] : [];
            $headers['Authorization'] = $authHeader;
            $options['headers'] = $headers;
        }

        if (!isset($options['retries'])) {
            $options['retries'] = $this->maxRetries;
        }

        return $this->requestHub($method, $uri, $options);
    }
960953
public function request($method, $url, $options)
    {
        $request = $this->authClient->getAuthenticatedRequest($method, $url, $this->getAccessToken());

        return $this->httpClient->send($request, $options);
    }
1071508
public function createRequest($method, $uri)
    {
        $uri = \is_string($uri)
            ? Uri::create($uri)
            : $uri;

        return new Request($method, $uri);
    }
1202485
public function request($method, $uri, $body = null, $options = [], $debug = false)
    {
        $options['timeout'] = $this->getTimeout();
        $options['headers'] = $this->headers;
        $options['debug']   = (bool) $debug;
        
        $options = $this->prepareRequestBody($body, $options);
    
        try {
            /** Log the request before sending it. */
            $logRequest = new Request(
                $this->getRequestId(),
                $method,
                $uri,
                $body,
                $this->protectedHeaders($this->headers),
                $this->protectedOptions($options)
            );
            
            $this->logger()->logRequest($logRequest);
        
            /** @var \Psr\Http\Message\ResponseInterface $request */
            $response = $this->httpClient()->request($method, $uri, $options);
    
            /** @var Api\Handler\Response\HandlerInterfaceSuccess $responseHandler */
            $responseHandler = new HandlerDefault($response);
    
            /** Log the request response. */
            $logResponse = $this->getLoggerResponse()->importResponseHandler($responseHandler);
        } catch (\GuzzleHttp\Exception\ClientException $clientException) {

            /** Service Request Exception */
            $responseHandler = new HandlerException($clientException);

            $logResponse = $this->getLoggerResponse()
                ->importResponseExceptionHandler($responseHandler);

        } catch (\Exception $exception) {

            /** Service Request Exception */
            $responseHandler = new HandlerException($exception);

            $logResponse = $this->getLoggerResponse()
                ->importResponseExceptionHandler($responseHandler);

        }
    
        $this->clear();
        $this->logger()->logResponse($logResponse);
        
        return $responseHandler;
    }
911744
public static function getInbox(PDFfiller $provider, $parameters = [])
    {
        $paramsArray =  self::query($provider, [self::INBOX], $parameters);
        $paramsArray['items'] = array_map(function ($entry) {
            $entry['recipients'] = [$entry['recipients']];
            $entry['except'] = ['callbacks'];

            return $entry;
        }, $paramsArray['items']);
        $paramsArray['items'] = static::formItems($provider, $paramsArray);

        return new ModelsList($paramsArray);
    }
204378
public function createRequest($method, $uri){
        if(!is_string($method)){
            throw new \InvalidArgumentException();
        }else if(!is_string($uri) && !($uri instanceof UriInterface)){
            throw new \InvalidArgumentException();
        }

        if(is_string($uri)){
            $uri    = new Uri($uri);
        }

        return new Request($method, $uri);
    }
370775
public function sendRequest($method, $params = [])
    {
        $request = $this->request($method, $params);
        $this->lastResponse = $this->client->sendRequest($request);
        if ($this->lastResponse->isError()) {
            $this->lastResponse->throwException();
        }

        return $this->lastResponse;
    }
132425
public function request($method, $uri, array $parameters = [], array $options = [])
    {
        $parameters['key'] = $this->apiKey;
        $options['query'] = $parameters;

        $uri = $this->apiUrl.$uri.'/json';

        $this->log($method, $uri, $options);
        $response = $this->httpClient->request($method, $uri, $options);

        $result = $this->decoder->decode($response);

        if (!isset($result['status'])) {
            throw new ClientErrorException('Missing return status');
        }

        if (!in_array($result['status'], [
                'OK',
                'ZERO_RESULTS',
            ], true)) {
            throw new ClientErrorException(sprintf('Invalid return status "%s"', $result['status']));
        }

        return $result;
    }
1363640
private function send (string $method, array $params)
		{

			$request = xmlrpc_encode_request($method, $params);

			$context = stream_context_create([ 'http' => [
				'method'  => "GET",
				'header'  => "Content-Type: text/xml",
				'content' => $request
			] ]);

			$file = file_get_contents($this->_url, false, $context);

			return xmlrpc_decode($file);
		}
1213209
protected function makeRequest($method, $uri, $parameters = [], $cookies = [], $files = [])
    {
        $uri = $this->prepareUrlForRequest($uri);

        $this->call($method, $uri, $parameters, $cookies, $files);

        $this->clearInputs()->followRedirects()->assertPageLoaded($uri);

        $this->currentUri = $this->app->make('request')->fullUrl();

        $this->crawler = new Crawler($this->response->getContent(), $this->currentUri);

        return $this;
    }
1343863
public function createServerRequest(
        string $method,
        $uri,
        array $serverParams = []
    ): ServerRequestInterface{
        if(!is_string($uri) && !is_subclass_of($uri, UriInterface::class)){
            $class  = UriInterface::class;
            throw new \InvalidArgumentException(
                "Second argument must be of the type string or {$class}, " . gettype($uri) . " given."
            );
        }

        return new ServerRequest(
            $method,
            is_string($uri) ? $this->getUriFactory()->createUri($uri) : $uri,
            $serverParams
        );
    }
557365
public function send($method, $uri, $body = null, array $query = [], array $headers = [], array $options = [])
    {
        $options = $this->enhanceOptions($body, $query, $headers, $options);

        try {
            $this->lastResponse = $this->client->request($method, $uri, $options);
        } catch (GuzzleException $e) {
            throw new ApiException($e->getMessage(), $e->getCode());
        }

        $this->validateResponse($this->lastResponse);

        return $this->lastResponse;
    }
950879
public static function query($provider, $entities = [], $params = [])
    {
        $url = self::resolveFullUrl($entities, $params);

        return static::apiCall($provider, 'query', $url);
    }