Create the HTTP client.

        Returns:
            Client: An instance of :class:`.http.Client`.
559700
def _build_http_client(cls, session: AppSession):
        '''
        '''
        # TODO:
        # recorder = self._build_recorder()

        stream_factory = functools.partial(
            HTTPStream,
            ignore_length=session.args.ignore_length,
            keep_alive=session.args.http_keep_alive)

        return session.factory.new(
            'HTTPClient',
            connection_pool=session.factory['ConnectionPool'],
            stream_factory=stream_factory
         )
544319
def create(self, **kwargs):
        """"""
        body = self.client.create(url=self.base_url,
                                  json=kwargs)
        return body
1041410
def create_new(self, body):
        
        return self.client.post(self._url(), data=body)
164603
def get_instance(self):
        
        return Instance(self.rest_client.make_request(self.instance), self.rest_client)
734068
protected OkHttpClient buildHttpClient() {
        OkHttpClient.Builder builder = new OkHttpClient.Builder()
                .readTimeout(readTimeoutMs, TimeUnit.MILLISECONDS)
                .writeTimeout(writeTimeoutMs, TimeUnit.MILLISECONDS);
        OkHttpClient client = builder.build();
        return client;
    }
1194115
async def create_http_connection(loop, protocol_factory, host, port=25105,
                                 auth=None):
    """"""
    protocol = protocol_factory()
    transport = HttpTransport(loop, protocol, host, port, auth)
    _LOGGER.debug("create_http_connection Finished creating connection")
    return (transport, protocol)
955027
protected function constructHttpClient()
    {
        $hasHttpClient = (null !== $this->httpClient);

        $this->httpClient = new HttpClient($this->getOptions());

        if (!$hasHttpClient) {
            $this->httpClient->registerDefaults();
        }
    }
1270807
def httpapi_request(client, **params) -> 'Response':
    
    return requests.get(
        _HTTPAPI,
        params={
            'client': client.name,
            'clientver': client.version,
            'protover': 1,
            **params
        })
266684
def create_controller(self):
        
        body = None
        req = self.request
        res = self.response
        rou = self.router
        con = None

        controller_info = {}
        try:
            controller_info = rou.find(req, res)

        except IOError as e:
            logger.warning(str(e), exc_info=True)
            raise CallError(
                408,
                "The client went away before the request body was retrieved."
            )

        except (ImportError, AttributeError, TypeError) as e:
            exc_info = sys.exc_info()
            logger.warning(str(e), exc_info=exc_info)
            raise CallError(
                404,
                "{} not found because of {} \"{}\" on {}:{}".format(
                    req.path,
                    exc_info[0].__name__,
                    str(e),
                    os.path.basename(exc_info[2].tb_frame.f_code.co_filename),
                    exc_info[2].tb_lineno
                )
            )

        else:
            con = controller_info['class_instance']

        return con
954859
public static HttpClient<ByteBuf, ByteBuf> newClient(ConnectionProviderFactory<ByteBuf, ByteBuf> providerFactory,
                                                         Observable<Host> hostStream) {
        return HttpClientImpl.create(providerFactory, hostStream);
    }
1321068
protected function createHttpClient()
    {
        $this->client = new GuzzleHttpClient($this->getEndpoint());
        $this->client->addSubscriber(new SignerPlugin($this->signer));
    }
1205041
def instantiate_client(self, config):
        
        modules = config.module.split('.')
        class_name = modules.pop()
        module_path = '.'.join(modules)

        client_instance = getattr(
            __import__(module_path, {}, {}, ['']),
            class_name
        )()

        client_instance.add_config(config)

        return client_instance
612398
def client(self):
        
        if not self.app.config['DOCKER_URL']:
            raise RuntimeError('"DOCKER_URL" must be specified')

        if not self.app.extensions['docker.client']:
            self.app.extensions['docker.client'] = Client(
                base_url=self.app.config['DOCKER_URL'],
                version=self.app.config['DOCKER_VERSION'],
                timeout=self.app.config['DOCKER_TIMEOUT'],
                tls=make_tls_config(self.app.config))
        return self.app.extensions['docker.client']
277765
def __create(self, client_id, client_secret, calls, **kwargs):
        
        params = {
            'client_id': client_id,
            'client_secret': client_secret,
            'calls': calls
        }
        return self.make_call(self.__create, params, kwargs)
326683
def oauth_client_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/oauth/clients.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
1009046
def client(self):
        """"""
        if isinstance(self._client, six.string_types):
            self._client = Client(self._client, self)

        return self._client
1361748
def create(self, virtual_host):
        
        virtual_host = quote(virtual_host, '')
        return self.http_client.put(API_VIRTUAL_HOST % virtual_host)