def request(self, method, api_endpoint, **kwargs):
while api_endpoint.startswith('<STR_LIT:/>'):<EOL><INDENT>api_endpoint = api_endpoint[<NUM_LIT:1>:]<EOL><DEDENT>kwargs.setdefault('<STR_LIT>', self._default_timeout)<EOL>json_data = kwargs.pop('<STR_LIT>', None)<EOL>if json_data is not None:<EOL><INDENT>headers = CaseInsensitiveDict(kwargs.get('<STR_LIT>', {}))<EOL>headers.setdefault('<STR_LIT:Content-Type>', '<STR_LIT:application/json>')<EOL>kwargs['<STR_LIT>'] = headers<EOL>kwargs['<STR_LIT:data>'] = json.dumps(json_data, sort_keys=True, separators=('<STR_LIT:U+002C>', '<STR_LIT::>'))<EOL><DEDENT>response = self._session.request(method, urljoin(str(self.host) + self._api_root, api_endpoint), **kwargs)<EOL>try:<EOL><INDENT>response.raise_for_status()<EOL><DEDENT>except requests.HTTPError as error:<EOL><INDENT>if error.response.status_code == <NUM_LIT>:<EOL><INDENT>raise SwimlaneHTTP400Error(error)<EOL><DEDENT>else:<EOL><INDENT>raise error<EOL><DEDENT><DEDENT>return response<EOL>
Wrapper for underlying :class:`requests.Session`

        Handles generating full API URL, session reuse and auth, request defaults, and invalid response status codes

        Used throughout library as the core underlying request/response method for all interactions with server

        Args:
            method (str): Request method (get, post, put, etc.)
            api_endpoint (str): Portion of URL matching API endpoint route as listed in platform /docs help page
            **kwargs (dict): Remaining arguments passed through to actual request call

        Notes:
            All other provided kwargs are passed to underlying :meth:`requests.Session.request()` call

        Raises:
            swimlane.exceptions.SwimlaneHTTP400Error: On 400 responses with additional context about the exception
            requests.HTTPError: Any other 4xx/5xx HTTP responses

        Returns:
            requests.Response: Successful response instances

        Examples:

            Request and parse server settings endpoint response

            >>> server_settings = swimlane.request('get', 'settings').json()