def _get_text_response(self, master_base_url, path, method='GET',
                           params=None, data=None):
        url = '{}/{}'.format(master_base_url, path.lstrip('/'))

        if params is None:
            params = {}

        self.logger.info('Fetching %r', url)
        resp = getattr(self.http_session, method.lower())(url, params=params,
                                                          data=data,
                                                          allow_redirects=False,
                                                          timeout=30,
                                                          auth=self.auth,
                                                          verify=self.verify)

        if resp.status_code == 404:
            raise NotFound
        elif not (200 <= resp.status_code < 400):
            exception_msg = 'Invalid response. Status code for %s was %s'
            attrs = url, resp.status_code
            self.logger.exception(exception_msg, *attrs)
            raise Exception(exception_msg % attrs)

        return resp.text
Make an HTTP request and return a text response.
dataset/ETHPy150Open dropbox/changes/changes/backends/jenkins/builder.py/JenkinsBuilder._get_text_response