Last active
March 11, 2019 03:50
-
-
Save jrbail01/c67660200828fec5a0eaf852637530a7 to your computer and use it in GitHub Desktop.
This file contains 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 requests | |
import json | |
ACCESS_KEY = "PLACE YOUR INITIAL STATE ACCESS KEY HERE" | |
BUCKET_KEY = "reqtest1" | |
def streamData(name, value): | |
url = 'https://groker.init.st/api/events' | |
headers = { | |
'Content-Type': 'application/json', | |
'X-IS-AccessKey': ACCESS_KEY, | |
'X-IS-BucketKey': BUCKET_KEY, | |
'Accept-Version': '~0' | |
} | |
data = { | |
'key': name, | |
'value': value | |
} | |
r = requests.post(url=url, headers=headers, data=json.dumps(data)) | |
return r | |
r = streamData("myNumber", 5) | |
print r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment