Last active
December 11, 2015 10:38
-
-
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/
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, 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