Quote from: vess on August 03, 2010, 06:02:00 PM
Thanks for the pointer, interesting, but not what seems to be affecting me.
Here’s my current code (running on Google App Engine)
postdata = jsonrpc.dumps({“method”: ‘getbalance’, “params”:”,‘id’:‘jsonrpc’}) req = urllib2.Request(‘http://127.0.0.1:8332’, postdata) userpass = ‘user:a’.encode(‘base64’)[:-1] authheader = “Basic %s” % userpass req.add_header(“Authorization”,authheader) handle = urllib2.urlopen(req) json_response = handle.read() self.response.out.write (json_response)
This yields a HTTPError: HTTP Error 500: Internal Server Error
This is a verified bug in bitcoin.
bitcoin requires the Content-Length header, but several JSON-RPC libraries do not provide it. When the Content-Length header is absent, bitcoin returns 500 Internal Server Error.