Couchdb Put design python -
hello i'm trying tu put design couchdb python i've got next code , when execute recive 400 error, can me? i've used requests module , i've been unable puth design couchdb python u.u thank yyou
import urllib2 import json import base64 url ="http://localhost:5984/pruebas/_design/example" data="" open("mydesign.json","rb") f: data+=json.dumps(f.readlines()) opener = urllib2.build_opener(urllib2.httphandler)) request = urllib2.request(url, data=data) request.add_header ("authorization", "basic %s" % base64.encodestring("user:password")) request.add_header("content-type", "application/json") request.get_method = lambda: "put" todo = opener.open(request)
Comments
Post a Comment