Skip to content

Instantly share code, notes, and snippets.

@rnewson
Created August 22, 2014 08:39
Show Gist options
  • Save rnewson/021845a7b77df5a117ea to your computer and use it in GitHub Desktop.
Save rnewson/021845a7b77df5a117ea to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import json
import requests
if __name__ == '__main__':
s = requests.Session()
s.put("http://localhost:5984/db1")
docs = []
for i in range(1, 1000):
docs.append({"foo":"bar"})
s.post("http://localhost:5984/db1/_bulk_docs",
headers = {"content-type": "application/json"},
data = json.dumps({"docs": docs}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment