Skip to content

Instantly share code, notes, and snippets.

@riklaunim
Created June 1, 2014 17:09
Show Gist options
  • Save riklaunim/1d1cb9bed76ec99a066f to your computer and use it in GitHub Desktop.
Save riklaunim/1d1cb9bed76ec99a066f to your computer and use it in GitHub Desktop.
import unirest
TEST_KEY = "...."
headers = {
"X-Mashape-Authorization": "..."
}
params = {
"un": "...",
"api_key": TEST_KEY,
"origin": "plot",
"platform": "python",
"version": "0.2",
"args": [{"x": [0, 1, 2], "y": [3, 1, 6], "name": "Experimental", "marker": {"symbol": "square", "color": "purple"}}, {"x": [1, 2, 3], "y": [3, 4, 5], "name": "Control"}],
"kwargs": {"filename": "plot from api", "fileopt": "overwrite", "style": { "type": "bar" }, "traces": [0,3,5], "layout": { "title": "experimental data" }},
}
response = unirest.post(
"https://plotly-plotly.p.mashape.com/",
headers=headers,
params=params,
)
print response.body, response.code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment