def http_request(self, verb, path, query_data={}, post_data=None,<EOL>streamed=False, files=None, **kwargs):
url = self._build_url(path)<EOL>params = {}<EOL>utils.copy_dict(params, query_data)<EOL>if '<STR_LIT>' in kwargs:<EOL><INDENT>utils.copy_dict(params, kwargs['<STR_LIT>'])<EOL>for arg in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>if arg in kwargs:<EOL><INDENT>params[arg] = kwargs[arg]<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>utils.copy_dict(params, kwargs)<EOL><DEDENT>opts = self._get_session_opts(content_type='<STR_LIT:application/json>')<EOL>verify = opts.pop('<STR_LIT>')<EOL>timeout = opts.pop('<STR_LIT>')<EOL>if files:<EOL><INDENT>data = post_data<EOL>json = None<EOL>del opts["<STR_LIT>"]["<STR_LIT>"]<EOL><DEDENT>else:<EOL><INDENT>json = post_data<EOL>data = None<EOL><DEDENT>req = requests.Request(verb, url, json=json, data=data, params=params,<EOL>files=files, **opts)<EOL>prepped = self.session.prepare_request(req)<EOL>prepped.url = utils.sanitized_url(prepped.url)<EOL>settings = self.session.merge_environment_settings(<EOL>prepped.url, {}, streamed, verify, None)<EOL>obey_rate_limit = kwargs.get("<STR_LIT>", True)<EOL>max_retries = kwargs.get("<STR_LIT>", <NUM_LIT:10>)<EOL>cur_retries = <NUM_LIT:0><EOL>while True:<EOL><INDENT>result = self.session.send(prepped, timeout=timeout, **settings)<EOL>self._check_redirects(result)<EOL>if <NUM_LIT:200> <= result.status_code < <NUM_LIT>:<EOL><INDENT>return result<EOL><DEDENT>if <NUM_LIT> == result.status_code and obey_rate_limit:<EOL><INDENT>if max_retries == -<NUM_LIT:1> or cur_retries < max_retries:<EOL><INDENT>wait_time = <NUM_LIT:2> ** cur_retries * <NUM_LIT:0.1><EOL>if "<STR_LIT>" in result.headers:<EOL><INDENT>wait_time = int(result.headers["<STR_LIT>"])<EOL><DEDENT>cur_retries += <NUM_LIT:1><EOL>time.sleep(wait_time)<EOL>continue<EOL><DEDENT><DEDENT>error_message = result.content<EOL>try:<EOL><INDENT>error_json = result.json()<EOL>for k in ('<STR_LIT:message>', '<STR_LIT:error>'):<EOL><INDENT>if k in error_json:<EOL><INDENT>error_message = error_json[k]<EOL><DEDENT><DEDENT><DEDENT>except (KeyError, ValueError, TypeError):<EOL><INDENT>pass<EOL><DEDENT>if result.status_code == <NUM_LIT>:<EOL><INDENT>raise GitlabAuthenticationError(<EOL>response_code=result.status_code,<EOL>error_message=error_message,<EOL>response_body=result.content)<EOL><DEDENT>raise GitlabHttpError(response_code=result.status_code,<EOL>error_message=error_message,<EOL>response_body=result.content)<EOL><DEDENT>
Make an HTTP request to the Gitlab server.

        Args:
            verb (str): The HTTP method to call ('get', 'post', 'put',
                        'delete')
            path (str): Path or full URL to query ('/projects' or
                        'http://whatever/v4/api/projecs')
            query_data (dict): Data to send as query parameters
            post_data (dict): Data to send in the body (will be converted to
                              json)
            streamed (bool): Whether the data should be streamed
            files (dict): The files to send to the server
            **kwargs: Extra options to send to the server (e.g. sudo)

        Returns:
            A requests result object.

        Raises:
            GitlabHttpError: When the return code is not 2xx