def request(self, **kwargs):
        """Generate HTTP request using given parameters.

        The request method prepares HTTP requests using class or
        method-level attributes/variables. Class-level attributes may be
        overridden by method-level variables offering greater
        flexibility and efficiency.

        Parameters:
            enforce_json (bool): Require properly-formatted JSON or raise :exc:`~pancloud.exceptions.HTTPError`. Defaults to ``False``.
            path (str): URI path to append to URL. Defaults to ``empty``.
            raise_for_status (bool): If ``True``, raises :exc:`~pancloud.exceptions.HTTPError` if status_code not in 2XX. Defaults to ``False``.

        Args:
            **kwargs: Supported :class:`~requests.Session` and :class:`~requests.adapters.HTTPAdapter` parameters.

        Returns:
            requests.Response: Requests Response() object

        """
        url = kwargs.pop('url', self.url)

        # Session() overrides
        auth = kwargs.pop('auth', self.session.auth)
        cert = kwargs.pop('cert', self.session.cert)
        cookies = kwargs.pop('cookies', self.session.cookies)
        headers = kwargs.pop('headers', self.session.headers.copy())
        params = kwargs.pop('params', self.session.params)
        proxies = kwargs.pop('proxies', self.session.proxies)
        stream = kwargs.pop('stream', self.session.stream)
        verify = kwargs.pop('verify', self.session.verify)

        # Non-Requests key-word arguments
        auto_refresh = kwargs.pop('auto_refresh', self.auto_refresh)
        credentials = kwargs.pop('credentials', self.credentials)
        enforce_json = kwargs.pop('enforce_json', self.enforce_json)
        path = kwargs.pop('path', '')  # default to empty path
        raise_for_status = kwargs.pop(
            'raise_for_status', self.raise_for_status
        )
        url = "{}:{}{}".format(url, self.port, path)

        if credentials:
            self._apply_credentials(
                auto_refresh=auto_refresh,
                credentials=credentials,
                headers=headers
            )

        k = {  # Re-pack kwargs to dictionary
            'params': params,
            'headers': headers,
            'cookies': cookies,
            'auth': auth,
            'proxies': proxies,
            'verify': verify,
            'stream': stream,
            'cert': cert
        }

        # Request() overrides
        for x in ['allow_redirects', 'data', 'json', 'method',
                  'timeout']:
            if x in kwargs:
                k[x] = kwargs.pop(x)

        # Handle invalid kwargs
        if len(kwargs) > 0:
            raise UnexpectedKwargsError(kwargs)

        try:
            method = k.pop('method')
        except KeyError:
            raise RequiredKwargsError('method')

        # Prepare and send the Request() and return Response()
        try:
            r = self._send_request(
                enforce_json, method, raise_for_status, url, **k
            )
            return r
        except requests.RequestException as e:
            raise HTTPError(e)
def request ( self , ** kwargs ) : url = kwargs . pop ( 'url' , self . url ) auth = kwargs . pop ( 'auth' , self . session . auth ) cert = kwargs . pop ( 'cert' , self . session . cert ) cookies = kwargs . pop ( 'cookies' , self . session . cookies ) headers = kwargs . pop ( 'headers' , self . session . headers . copy ( ) ) params = kwargs . pop ( 'params' , self . session . params ) proxies = kwargs . pop ( 'proxies' , self . session . proxies ) stream = kwargs . pop ( 'stream' , self . session . stream ) verify = kwargs . pop ( 'verify' , self . session . verify ) auto_refresh = kwargs . pop ( 'auto_refresh' , self . auto_refresh ) credentials = kwargs . pop ( 'credentials' , self . credentials ) enforce_json = kwargs . pop ( 'enforce_json' , self . enforce_json ) path = kwargs . pop ( 'path' , '' ) raise_for_status = kwargs . pop ( 'raise_for_status' , self . raise_for_status ) url = "{}:{}{}" . format ( url , self . port , path ) if credentials : self . _apply_credentials ( auto_refresh = auto_refresh , credentials = credentials , headers = headers ) k = { 'params' : params , 'headers' : headers , 'cookies' : cookies , 'auth' : auth , 'proxies' : proxies , 'verify' : verify , 'stream' : stream , 'cert' : cert } for x in [ 'allow_redirects' , 'data' , 'json' , 'method' , 'timeout' ] : if x in kwargs : k [ x ] = kwargs . pop ( x ) if len ( kwargs ) > 0 : raise UnexpectedKwargsError ( kwargs ) try : method = k . pop ( 'method' ) except KeyError : raise RequiredKwargsError ( 'method' ) try : r = self . _send_request ( enforce_json , method , raise_for_status , url , ** k ) return r except requests . RequestException as e : raise HTTPError ( e )
Generate HTTP request using given parameters.

        The request method prepares HTTP requests using class or
        method-level attributes/variables. Class-level attributes may be
        overridden by method-level variables offering greater
        flexibility and efficiency.

        Parameters:
            enforce_json (bool): Require properly-formatted JSON or raise :exc:`~pancloud.exceptions.HTTPError`. Defaults to ``False``.
            path (str): URI path to append to URL. Defaults to ``empty``.
            raise_for_status (bool): If ``True``, raises :exc:`~pancloud.exceptions.HTTPError` if status_code not in 2XX. Defaults to ``False``.

        Args:
            **kwargs: Supported :class:`~requests.Session` and :class:`~requests.adapters.HTTPAdapter` parameters.

        Returns:
            requests.Response: Requests Response() object