<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _http_request(self, method, url_path, headers=None, query_params=None, body_params=None, files=None, **kwargs):
 """ Method to do http requests. :param method: :param url_path: :param headers: :param body_params: :param query_params: :param files: (optional) Dictionary of ``'name': file-like-objects`` (or ``{'name': file-tuple}``) for multipart encoding upload. ``file-tuple`` can be a 1-tuple ``('filepath')``, 2-tuple ``('filepath', 'content_type')`` or a 3-tuple ``('filepath', 'content_type', custom_headers)``, where ``'content-type'`` is a string defining the content type of the given file and ``custom_headers`` a dict-like object containing additional headers to add for the file. :param update_content_type: (bool) Update headers before performig the request, adding the Content-Type value according to the rendered body. By default: True. :return: """

        host = kwargs.get('host', self.host)
        proxy = kwargs.get('proxy', self.proxy)
        renderer = kwargs.get('renderer', MultiPartRenderer() if files else self.default_renderer)
        prefix_url_path = kwargs.get('prefix_url_path', self.prefix_url_path)
        authentication_instances = kwargs.get('authentication_instances', self.authentication_instances)
        url_path_format = kwargs.get('url_path_format', self.url_path_format)
        update_content_type = kwargs.get('update_content_type', True)
        redirect = kwargs.get('redirect', False)

        if headers is None:
            headers = self.default_headers()

        context = HttpRequestContext(
            host=host, proxy=proxy, method=method,
            prefix_url_path=prefix_url_path,
            url_path=url_path,
            url_path_params=self.url_path_params,
            url_path_format=url_path_format,
            headers=headers,
            query_params=query_params,
            body_params=body_params,
            files=files,
            renderer=renderer,
            response_class=self.response_class,
            authentication_instances=authentication_instances,
            update_content_type=update_content_type,
            redirect=redirect
        )
        res = self.http_request_from_context(context)
        self.cookie.update(res.cookie)
        return res