Set Http options.

@author yansongda <me@yansongda.cn>

@return self
178369
protected function setHttpOptions(): self
    {
        if ($this->config->has('http') && is_array($this->config->get('http'))) {
            $this->config->forget('http.base_uri');
            $this->httpOptions = $this->config->get('http');
        }

        return $this;
    }
235754
public function withCookies(): self
    {
        return tap($this, function ($request) {
            return $this->options = array_merge_recursive($this->options, [
                'cookies' => static::getCookieJar(),
            ]);
        });
    }
616899
protected function setPostCurlopts()
    {
        $curlopts = [
            CURLOPT_HTTPHEADER => $this->headers,
            CURLOPT_POST => 1,
            CURLOPT_POSTFIELDS => $this->postFields,
            CURLOPT_HEADER => 0,
            CURLOPT_SSL_VERIFYPEER => false,
            CURLOPT_VERBOSE => false,
            CURLOPT_RETURNTRANSFER => true
        ];

        return $curlopts;
    }
453831
public function getHttpOptions()
    {
        $options = array(
            'headers' => $this->getHttpHeaders(),
            'connect_timeout' => $this->timeout,
            'timeout' => $this->timeout,
        );
        if ($this->credentials) {
            $options['auth'] = $this->credentials;
        }
        if ($this->proxy) {
            $options['proxy'] = $this->proxy;
        }
        return $options;
    }
348734
public function setParameters()
	{		
		//set the url parameter from the UrlParserObjectInstance
		$this->parameters = $this->UrlParserObjectInstance->getParameters();

		//populate the Input Class data
		Input::setGet()->setPost();
		
		//return this object instance
		return $this;

	}
69037
private function setRequestOptions()
    {
        $authBearer = 'Bearer '. $this->secretKey;

        $this->client = new Client(
            [
                'base_uri' => $this->baseUrl,
                'headers' => [
                    'Authorization' => $authBearer,
                    'Content-Type'  => 'application/json',
                    'Accept'        => 'application/json'
                ]
            ]
        );
    }
511285
private function setUp(): self
    {
        fn::allowCors();
        fn::allowHeader();
        $this->configApp();
        $this->configRoutes();

        return $this;
    }
228919
protected function _setOptions()
    {
        $this->_Memcached->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true);

        $serializer = strtolower($this->_config['serialize']);
        if (!isset($this->_serializers[$serializer])) {
            throw new InvalidArgumentException(
                sprintf('%s is not a valid serializer engine for Memcached', $serializer)
            );
        }

        if ($serializer !== 'php' &&
            !constant('Memcached::HAVE_' . strtoupper($serializer))
        ) {
            throw new InvalidArgumentException(
                sprintf('Memcached extension is not compiled with %s support', $serializer)
            );
        }

        $this->_Memcached->setOption(
            Memcached::OPT_SERIALIZER,
            $this->_serializers[$serializer]
        );

        // Check for Amazon ElastiCache instance
        if (defined('Memcached::OPT_CLIENT_MODE') &&
            defined('Memcached::DYNAMIC_CLIENT_MODE')
        ) {
            $this->_Memcached->setOption(
                Memcached::OPT_CLIENT_MODE,
                Memcached::DYNAMIC_CLIENT_MODE
            );
        }

        $this->_Memcached->setOption(
            Memcached::OPT_COMPRESSION,
            (bool)$this->_config['compress']
        );
    }
636705
public function setDefaultsFromConfiguration()
    {
        $set = [
            "urlType",
            "siteUrl",
            "baseUrl",
            "staticSiteUrl",
            "staticBaseUrl",
            "scriptName",
        ];
        
        foreach ($set as $item) {
            if (!isset($this->config[$item])) {
                continue;
            }
            
            $this->$item = $this->config[$item];
        }

        return $this;
    }
1195659
public function setOptions($options = [])
    {
        $this->options = $options;
        $this->debug->info(__FUNCTION__, 'setOptions: ', $this->options);

        return $this;
    }
916192
protected function http() {
        // 若$this->http不是\GuzzleHttp\Client实例，则创建一个
        if (!$this->http instanceof Client) {
            $this->http = new Client(
                array_merge(
                    [ 'base_uri' => $this->url ],
                    $this->options
                )
            );
        }

        return $this->http;
    }
490784
public function setOptions(array $options)
    {
        $this->validateOptions($options, $this->type);

        $this->options = $options;

        return $this;
    }
296625
protected function setCommonApiParameters()
    {
        if (!empty($this->devKey)) {
            $this->setApiParameter('developerkey', $this->devKey);
        }

        $this->validator->validateApiKeys($this->apiKeys);
        $this->setApiParameter('apikey', implode(',', $this->apiKeys));

        return $this;
    }
1168720
public function setOptions($options = [])
    {
        if (!is_array($options)) {
            $options = [];
        }

        $this->options = array_merge($this->getDefaults(), $options);
        return $this;
    }
638309
public function disableHttpsTransformOnHttpsConnections(): self
    {
        $this->needsCompile = ($this->needsCompile || $this->httpsTransformOnHttpsConnections !== false);
        $this->httpsTransformOnHttpsConnections = false;

        return $this;
    }
407252
protected function setOptions()
    {
        foreach ($this->getEnvironmentParameters() as $name => $value) {
            $this->setOption(constant($name), $value);
        }

        $this->setOption(CURLOPT_HTTPHEADER, $this->getHeader());
        $this->setOption(CURLOPT_URL, $this->getUrlToCall());
        $this->setOption(CURLOPT_POSTFIELDS, $this->getQuery());
    }
1354675
public function on() : self
    {
        $this->handler->setErrorHandler();
        $this->handler->setExceptionHandler();
        $this->handler->setFatalHandler();

        return $this;
    }