Last active
December 9, 2017 17:06
-
-
Save gduverger/9fe6c95cbd93f5840fa879af8885ec84 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import base64 | |
import requests | |
URL = 'https://logs.timber.io/frames' | |
TOKEN = base64.urlsafe_b64encode(os.environ.get('TIMBER_API_KEY').encode('utf-8')).decode('utf-8') | |
HEADERS = { | |
'Content-Type': 'text/plain', | |
'Cache-Control': 'no-cache', | |
'Authorization': 'Basic {}'.format(TOKEN) | |
} | |
def log(data='hello'): | |
response = requests.post(URL, headers=HEADERS, data=data) | |
print(response, response.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment