Skip to content

Instantly share code, notes, and snippets.

@refactornator
Last active December 11, 2015 10:38
Show Gist options
  • Save refactornator/4588096 to your computer and use it in GitHub Desktop.
Save refactornator/4588096 to your computer and use it in GitHub Desktop.
An example of how to upload data to the Zoomdata Upload API. Send an HTTP POST to your Zoomdata Server that contains a JSON object in the request body. Dependencies: requests - http://docs.python-requests.org/en/latest/
import requests, json
headers = {'Content-type': 'application/json'}
params = {'source':'API Test'}
data = {"product":"widget", "price":"19.95", "quantity":10}
url = "https://localhost:8443/zoomdata/service/upload"
r = requests.post(url, data=json.dumps(data), headers=headers, params=params, auth=('username', 'password'), verify=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment