code: def set_basic_auth(self, username, password):
          
          credentials = str(b64encode('{}:{}'.format(username, password).encode('utf-8')), 'utf-8')
          self.authorization = 'Basic {}'.format(credentials)
docs: Manually set basic auth in the header when normal method does not work.