in cloud9/stream.py [0:0]
def get_bearer_token(self):
response = requests.post(
self.bearer_token_url,
auth=(self.consumer_key, self.consumer_secret),
data={'grant_type': 'client_credentials'},
headers={'User-Agent': 'TwitterDevFilteredStreamQuickStartPython'})
if response.status_code is not 200:
raise Exception(f"Cannot get a Bearer token (HTTP %d): %s" % (response.status_code, response.text))
body = response.json()
return body['access_token']