@param        $entity
@param string $method
@param null   $parameters

@return mixed
976426
public function execute($entity, $method = 'get', $options = [])
    {

        $this->cleanQueryParams($entity);
        $configuration = $this->_getEntityConfiguration($entity);

        if ($method != 'get'){
            foreach ($configuration->attributes as $key => $attribute) {
                $this->validateAttribute($entity, $key, ['required']);
            } 
        }

        $this->processOptions($options, $configuration);

        $this->_setDefaultHeaders($configuration->query);
        $this->_setCustomHeaders($entity, $configuration->query);
        //$this->_setIdempotencyHeader($configuration->query, $configuration, $method);
        $this->setQueryParams($entity);
        
        return $this->_client->{$method}($configuration->url, $configuration->query);
    }
686494
protected function encode($method, array $parameters = [])
    {
        $this->encoder = $this->encoder ?: new XmlrpcEncoder();

        return $this->encoder->encodeCall($method, $parameters);
    }
800920
public function call($method, $params = [])
    {
        if (null === $this->client) {
            $this->client = new Client([
                'base_uri' => static::API_URL,
                'content-type' => 'application/json',
            ]);
        }

        $requestParams = array_merge($this->defaultParams, [
            $method => [$params],
        ]);

        if ($this->sandbox) {
            $requestParams['apikey'] = self::SANDBOX_KEY;
        }

        $response = $this->client->post(null, ['body' => json_encode($requestParams)]);
        if ($response->getStatusCode() != 200) {
            throw new \Exception('Api http error: ' . $response->getStatusCode(), $response->getStatusCode());
        }

        $result = json_decode($response->getBody(), true);
        if (isset($result['error'])) {
            throw new \BadMethodCallException('Api error: ' . $result['error']['description'],
                $result['error']['code']);
        }

        return $result;
    }
369056
protected function generateMethods(Entity $entity)
    {
        $result     = [];
        $descriptor = $entity->getDescriptor();
        $methods    = $descriptor->getMethodList() ?: [];

        foreach ($methods as $method) {
            $result[] = $this->generateMethod($entity, $method);
        }

        return $result;
    }
677186
public function call($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null)
    {
        $kernel = $this->app->make('Illuminate\Contracts\Http\Kernel');

        $this->currentUri = $this->prepareUrlForRequest($uri);

        $this->resetPageContext();

        $symfonyRequest = SymfonyRequest::create(
            $this->currentUri, $method, $parameters,
            $cookies, $this->filterFiles($files), array_replace($this->serverVariables, $server), $content
        );

        $request = Request::createFromBase($symfonyRequest);

        $response = $kernel->handle($request);

        $kernel->terminate($request, $response);

        return $this->response = $response;
    }
476353
public function resolveMethodParameters($instance, $method, $parameters, $labels = false)
    {
        // method reflection
        $reflectionMethod = new ReflectionMethod($instance, $method);

        // resolved array of parameters
        return $this->resolveParameters($reflectionMethod->getParameters(), $parameters, $labels);
    }
821745
private function checkParametersResolving($method, array $params = [])
    {
        if (!$this->resolveMethods) {
            return $params;
        }

        return app()->make(ServiceShortCuts::RESOLVER_SERVICE)->resolveMethodParameters($this, $method, $params);
    }
434030
protected static function getParam($method, $key, $default = NULL) {
        if ($method == 0) {  // POST Method
            if (isset($_REQUEST[$key]) && is_array($_REQUEST[$key])) {
                $param = filter_input($method, $key, FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY);
            } else {
                $param = filter_input($method, $key, FILTER_SANITIZE_STRING, FILTER_REQUIRE_SCALAR);
            }
        } else if ($method == 1) {  // GET Method
            $param = filter_input($method, $key, FILTER_SANITIZE_STRING);
        }

        return $param ? $param : $default;
    }
880069
private function buildUrlByMethodName($method, array $parameters)
    {
        $url = $this
            ->apiUrls
            ->$method();

        return $this->host
            ? $this->buildUrlWithHost(
                $url,
                $parameters
            )
            : $this->buildUrlWithoutHost(
                $url,
                $parameters
            );
    }
851954
public function call(string $method, array $parameters)
    {
        if ($this->isSingleRequest) {
            $this->units = [];
        }

        $this->units[] = new Invoke($this->generatorId->get(), $method, $parameters);

        if ($this->isSingleRequest) {
            $resultSpecifier = $this->execute(new InvokeSpec($this->units, true));

            if (!$resultSpecifier->isSingleResult()) {
                throw new InvalidResponseException();
            }

            list($result) = $resultSpecifier->getResults();

            if ($result instanceof Result) {
                /** @var Result $result */
                return $result->getResult();
            } elseif ($result instanceof Error) {
                /** @var Error $result */
                if ($this->serverErrorMode === self::ERRMODE_EXCEPTION) {
                    throw $result->getBaseException();
                }
            }

            return null;
        }

        return $this;
    }
446742
public function invokeRemote($uri, $method, $parameters = array())
    {
        $remoteClient = $this->getRemoteClient();

        // Make request.
        $request = call_user_func_array(array($remoteClient, $method), array($uri, null, $parameters));

        // Send request.
        $response = $request->send();

        // Body responsed.
        $body = (string) $response->getBody();

        // Decode json content.
        if ($response->getContentType() == 'application/json')
        {
            if (function_exists('json_decode') and is_string($body))
            {
                $body = json_decode($body, true);
            }
        }

        return $body;
    }
595388
public function notification(string $method, array $parameters)
    {
        if ($this->isSingleRequest) {
            $this->units = [];
        }

        $this->units[] = new Notification($method, $parameters);

        if ($this->isSingleRequest) {
            $this->execute(new InvokeSpec($this->units, true));
            return null;
        }

        return $this;
    }
878160
protected function generateMethod(Entity $entity)
    {
        $lines   = $this->generateBody($entity);
        $body    = implode(PHP_EOL, $lines);
        $method  = MethodGenerator::fromArray([
            'name'       => 'fromArray',
            'body'       => $body,
            'static'     => true,
            'parameters' => [
                [
                    'name'          => 'values',
                    'type'          => 'array',
                ]
            ],
            'docblock'   => [
                'shortDescription' => "{@inheritdoc}"
            ]
        ]);

        return $method;
    }
1078460
public function request($method, $path = null, $parameters = array())
    {
        if (null === $path) {
            $url = '/messages';
        } else {
            $url  = '/messages/'.$path;
        }

        return json_decode($this->requestRaw($method, $url, $parameters), true);
    }
58414
protected function generateToStreamMethod(Entity $entity)
    {
        $lines   = $this->generateBody($entity);
        $body    = implode(PHP_EOL, $lines);
        $method  = MethodGenerator::fromArray([
            'name'       => 'toStream',
            'body'       => $body,
            'parameters' => [
                [
                    'name'          => 'configuration',
                    'type'          => '\Protobuf\Configuration',
                    'defaultValue'  => null
                ]
            ],
            'docblock'   => [
                'shortDescription' => "{@inheritdoc}"
            ]
        ]);

        return $method;
    }
598351
final public function get($method = null) {

        if ( empty($method) ) {

            $return = $this->rpc_methods;

        } else if ( array_key_exists($method, $this->rpc_methods) ) {

            $return = $this->rpc_methods[$method];

        } else {

            $return = null;

        }

        return $return;

    }
1199767
protected function generateMethod(Entity $entity, MethodDescriptorProto $method)
    {
        $inputClass  = $this->getMethodInputTypeHint($method);
        $inputDoc    = $this->getMethodInputDocblock($method);
        $outputDoc   = $this->getMethodOutputDocblock($method);
        $methodName  = $this->getCamelizedValue($method->getName());
        $method      = MethodGenerator::fromArray([
            'name'       => $methodName,
            'parameters' => [
                [
                    'name'   => 'input',
                    'type'   => $inputClass
                ]
            ],
            'docblock' => [
                'tags'             => [
                    [
                        'name'        => 'param',
                        'description' =>  $inputDoc . ' $input'
                    ],
                    [
                        'name'        => 'return',
                        'description' =>  $outputDoc
                    ]
                ]
            ]
        ]);

        return $method;
    }