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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -