Created
December 15, 2013 17:22
-
-
Save mxpr/7975620 to your computer and use it in GitHub Desktop.
Example of how to send data to dashing from python
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
# http://stackoverflow.com/questions/20211990/sending-data-curl-json-in-python | |
import requests #pip install requests | |
import simplejson as json #pip install simplejson | |
url = "http://<ip-address>:3030" | |
widget = "welcome" | |
data = { "auth_token": "YOUR_AUTH_TOKEN", "text": "Python Greetings!!" } | |
fullUrl = "%s/widgets/%s" % (url, widget) | |
headers = {'Content-type': 'application/json'} | |
requests.post(fullUrl, data=json.dumps(data), headers=headers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this really helped me! Thanks for sharing this! :)