Builds a request

@param string $service
@param string $requestId
@param array  $parameters

@return Request

@throws RequestBuildException
@throws RuntimeException
760771
protected function createRequest($service, $requestId, array $parameters = [])
    {
        try {
            return $this->factory()->create($service, $requestId, $parameters);
        } catch (RuntimeException $exception) {
            $this->logBuildError($service, $requestId, $exception);
            throw $exception;
        } catch (\Exception $exception) {
            $this->logBuildError($service, $requestId, $exception);
            throw new RequestBuildException($exception);
        }
    }
1049936
public function call(string $service, ...$params)
    {
        return Container::getInstance()->make(ServiceCaller::class)->call($service, ...$params);
    }
911884
protected function buildRequest($method, $url, $params = [])
    {
        if (count($params) > 0) {
            $url .= strpos($url, '?') === false ? '?' : '&';
            $url .= http_build_query($params);
        }
        return new Request($url, $method);
    }
751063
public function _createHttpRequest($apiMethod, array $params = [], $requestMethod = "POST")
    {
        $apiUrl = $this->baseUrl . $apiMethod;
        $client     = new Client();

        if ($requestMethod == "POST")
        {
            $client->requestConfig = ['format' => Client::FORMAT_JSON];
        }

        $request    = $client
            ->createRequest()
            ->setUrl($apiUrl)
            ->setMethod($requestMethod)
            ->addHeaders(['Authorization' => "Token " . $this->authorization_token])
            ->addHeaders(['Accept' => 'application/json'])
            ->setData($params)
            ->setOptions([
                'timeout' => $this->timeout
            ])
        ;

        if ($requestMethod == "POST")
        {
            return $request->addHeaders(['Content-type' => 'application/json']);

        } else if ($requestMethod == "GET")
        {
            return $request;
        }

        throw new \InvalidArgumentException("Method {$requestMethod} not allow");
    }
183961
public function build($service = null)
    {
        if (!$this->sender) {
            $this->sender = $this->buildGuzzleSender();
        }

        if (!$this->factory) {
            throw new RuntimeException("You need to provide a configuration or a factory for requests");
        }

        if (!$this->logger) {
            $this->logger = new NullLogger();
        }

        return $this->buildClient($this->factory, $this->sender, $this->logger, $service);
    }
371297
private function buildRequest($url, array $headers = []): RequestInterface
    {
        $request = $this->requestFactory->createRequest('GET', $url);
        foreach ($headers as $header => $value) {
            $request = $request->withHeader($header, $value);
        }

        return $request;
    }
1047199
protected function makeRequest($path, $requestId, array $params)
	{
		if ($this->appendId($requestId))
		{
			$path .= "/$requestId";
		}

		return $this->request($path, $params, true);
	}
701726
public function buildRequest($resource, $args = [], $method = 'get')
    {
        $query = [];

        if (isset($args[0]) && count($args[0]) == 1 && is_int($args[0])) {
            $resource = $resource.'/'.$args[0];
        }

        if (!empty($this->query)) {
            $query = $this->query;
        }

        return $this->sendRequest($resource, $query, $method);
    }
1219259
public static function createRequest($method, $uri)
    {
        if (! static::$requestFactory) {
            static::$requestFactory = new RequestFactory();
        }

        return static::$requestFactory->createRequest($method, $uri);
    }
659063
private function createRequest(
        SapiInterface $sapi,
        PsrContainerInterface $container,
        callable $requestFactory
    ): ServerRequestInterface {
        // check the factory method signature
        assert(
            $this->checkPublicStaticCallable(
                $requestFactory,
                [SapiInterface::class, PsrContainerInterface::class],
                ServerRequestInterface::class
            ),
            'Factory method should have signature ' .
            '`public static methodName(SapiInterface, PsrContainerInterface): ServerRequestInterface`'
        );

        $request = call_user_func($requestFactory, $sapi, $container);

        return $request;
    }
1357299
public function buildServiceTable($services)
    {
        $table = new TableHelper;
        $table->setHeaders($this->buildTableHeaders());
        $table->setRows($this->buildTableRows($services));
        return $table;
    }
128661
public function customRequest($service, $method = 'GET', $headers = null, $data = null)
	{
		$serviceUrl = $this->urlService($service);
		$request = new Request($serviceUrl, $method);
		$headers = $this->recieveHeaders($headers);
		if(null !== $headers)
		{
			$request->setHeaders($headers);
		}
		if(null !== $data)
		{
			$data = $this->dataFormalize($data);
			$request->setContent($data);
		}
		$request->setFormat($this->resource);
		return $request;
	}
1044197
public function build(): RequestDatabaseRequest
	{
		$instance = new RequestDatabaseRequest();
		if ($this->securityOrigin === null) {
			throw new BuilderException('Property [securityOrigin] is required.');
		}
		$instance->securityOrigin = $this->securityOrigin;
		if ($this->databaseName === null) {
			throw new BuilderException('Property [databaseName] is required.');
		}
		$instance->databaseName = $this->databaseName;
		return $instance;
	}
624698
public function get($uri, array $parameters = array(), $requestHeaders = array()) {
        try {
            return $this->executeGet($uri, $parameters, $requestHeaders);
        } catch (Unauthenticated $e) {
            $this->auth_token->reset();
            return $this->executeGet($uri, $parameters, $requestHeaders);
        }
    }
453987
protected function build( $service ){

            $this->validateConfig( $service );

            // set default endpoint
            $this->setEndpoint();

            // set web service parameters
            $this->service = config('googlemaps.service.'.$service);

            // is service key set, use it, otherwise use default key
            $this->key = empty( $this->service['key'] )
                         ? config('googlemaps.key')
                         : $this->service['key'];

            // set service url
            $this->requestUrl = $this->service['url'];

            // is ssl_verify_peer key set, use it, otherwise use default key
            $this->verifySSL = empty(config('googlemaps.ssl_verify_peer'))
                            ? FALSE
                            :config('googlemaps.ssl_verify_peer');

            $this->clearParameters();
    }
630741
public function createRequest($httpMethod, $path, $body = null, array $headers = [])
	{
		return new Request(
			$httpMethod,
			$path,
			array_merge($this->headers, $headers),
			$body
		);
	}
579436
protected function soap(string $service, string $action, array $params = [])
    {
        $params["ID"] = $this->id;

        return $this->getSpeaker()->soap($service, $action, $params);
    }