Skip to content

Instantly share code, notes, and snippets.

@harthur
Created August 6, 2010 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harthur/512010 to your computer and use it in GitHub Desktop.
Save harthur/512010 to your computer and use it in GitHub Desktop.
import httplib
import json
result = {
"firefox": {
"build_id": "20100401064631",
"version": "3.6.3"
},
"run_id": 0,
"timestamp": 1279376772,
"results": [
1914,
1169,
1154,
1159,
1180
],
"addon": {
"downloads": 12398,
"id": 5677,
"name": "Reframe It"
},
"os": {
"version": "OS X 10.6.2",
"bits": "64",
"name": "Mac",
"cpu": "x86_64"
},
"test_type": "ts"
}
connection = httplib.HTTPConnection('localhost:5984')
connection.request("POST", '/testdb', json.dumps(result))
# Get response which contains the id of the new document
response = connection.getresponse()
data = json.loads(response.read())
connection.close()
if not data['ok']:
print "creating report document failed"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment