code: def login(self):
          
          # perform the request
          data = {'apikey': self.apikey, 'username': self.username, 'password': self.password}
          r = self.session.post(self.base_url + '/login', json=data)
          r.raise_for_status()
  
          # set the Authorization header
          self.session.headers['Authorization'] = 'Bearer ' + r.json()['token']
  
          # update token_date
          self.token_date = datetime.utcnow()
docs: Login