Created
August 22, 2014 08:39
-
-
Save rnewson/021845a7b77df5a117ea to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/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