获取httpClient对象

@return Client
770648
public static function getHttpClient()
    {
        if(self::$httpClient) {
            return self::$httpClient;
        }
        $client = new Client();
        return self::$httpClient = $client;
    }
972216
protected function httpConnect()
    {
        $this->client = new Client(array('timeout' => $this->timeout));
        $this->client->setUserAgent($this->userAgent);
        $this->client->setBaseURL(sprintf(
            '%s://%s:%d',
            $this->connectionUrlInfo['scheme'],
            $this->connectionUrlInfo['host'],
            $this->connectionUrlInfo['port']
        ));
    }
38543
protected function httpClient()
    {
        if (null === $this->obj_http_client) {
            $this->obj_http_client = $this->initHttpClient();
        }
        return $this->obj_http_client;
    }
265285
public function getUserClient()
    {
        if (!$this->userClient) {
            $this->userClient = Factory::getUserClient(
                null, $this->configuration->getApiKey(), [Factory::API_BASE_URL => $this->configuration->getApiUri()]
            );
        }

        return $this->userClient;
    }
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;
    }
427608
public function bindHttpClient()
    {
        $this->app->bind(HttpClient::class, function (Application $app) {
            $client = $app->make('ej:sdk:guzzle');
            $auth = $app->make(Authentication\Authenticator::class);

            return new HttpClient($client, $auth);
        });
    }
845260
protected function getHttpClient()
    {
        if (is_null($this->httpClient)) {
            $this->httpClient = new Client($this->guzzle);
        }

        return $this->httpClient;
    }
1011090
public function createDefaultHttpClient()
    {
        $stack = HandlerStack::create();

        $middleware = new Oauth1([
            'consumer_key'    => $this->consumerKey,
            'consumer_secret' => $this->consumerSecret,
            'token'           => $this->token,
            'token_secret'    => $this->tokenSecret
        ]);

        $stack->push($middleware);

        return new HttpClient([
            'handler' => $stack
        ]);
    }
1075606
public function getApiClient()
    {
        if (!$this->_apiClient) {
            $this->_apiClient = new OAuth2([
                'clientId' => $this->clientID,
                'clientSecret' => $this->clientSecret,
                'cacheComponent' => $this->cacheComponent,
            ]);
        }
        return $this->_apiClient;
    }
904536
private function _getClient(): ClientInterface
    {
        if (! $this->client instanceof ClientInterface) $this->client = new Client($this->clientConfig);
        return $this->client;
    }
1234041
protected function client()
    {
        $apiKey = $this->config('apiKey');
        if (!$apiKey) {
            return null;
        }

        $endpoint = $this->config('endpoint');
        $defaults = $this->config('defaults');
        if ($defaults === null) {
            $defaults = true;
        }
        $client = Client::make($apiKey, $endpoint, $defaults);

        return $client;
    }
655201
public function getHttpClient()
    {
        if (!is_object($this->_httpClient)) {
            $this->_httpClient = new Client([
                'baseUrl' => $this->baseUrl,
                'requestConfig' => [
                    'options' => $this->requestOptions
                ],
                'responseConfig' => [
                    'format' => Client::FORMAT_JSON
                ],
            ]);
        }
        return $this->_httpClient;
    }
1118616
public function getHttpClient()
    {
        if (is_null($this->httpClient)) {
            $this->httpClient = $this->getDefaultHttpClient();
        }

        return $this->httpClient;
    }
18846
def http_client(self):
        ''''''
        client = http.HttpClient(decompress=False, store_cookies=False)
        client.headers.clear()
        return client
852438
public function getClientConnection()
    {
        if (!$this->serviceClient) {
            $this->createClient();
        }

        if (!$this->serviceClient->isAlive()) {
            $this->serviceClient->connect();
        }

        return $this->serviceClient;
    }
700094
public function client()
    {
        $query = $this->pdo->prepare(<<<SQL
SELECT
  content,
  statusCode,
  nextUpdate,
  effective,
  worker,
  UNIX_TIMESTAMP()
FROM robotstxt__cache1
WHERE base = :base;
SQL
        );
        $query->bindValue('base', $this->base, \PDO::PARAM_STR);
        $query->execute();
        if ($query->rowCount() > 0) {
            $row = $query->fetch(\PDO::FETCH_ASSOC);
            $this->clockSyncCheck($row['UNIX_TIMESTAMP()'], self::OUT_OF_SYNC_TIME_LIMIT);
            if ($row['nextUpdate'] >= $row['UNIX_TIMESTAMP()']) {
                $this->markAsActive($row['worker']);
                return new TxtClient($this->base, $row['statusCode'], $row['content'], self::ENCODING, $row['effective'], $this->byteLimit);
            }
        }
        $query = $this->pdo->prepare(<<<SQL
UPDATE robotstxt__cache1
SET worker = 0
WHERE base = :base;
SQL
        );
        $query->bindValue('base', $this->base, \PDO::PARAM_STR);
        $query->execute();
        return $this->refresh();
    }
1042023
public function getHttpClient()
    {
        $this->options['headers'] = $this->getHeaders();
        return \SapiStudio\Http\Browser\StreamClient::make($this->options);
    }