Skip to content

Instantly share code, notes, and snippets.

@mxpr
Created December 15, 2013 17:22
Show Gist options
  • Save mxpr/7975620 to your computer and use it in GitHub Desktop.
Save mxpr/7975620 to your computer and use it in GitHub Desktop.
Example of how to send data to dashing from python
# 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)
@noisy
Copy link

noisy commented Nov 20, 2016

this really helped me! Thanks for sharing this! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment