Quote from: vess on August 03, 2010, 06:02:00 PM
ポインタをありがとう。興味深いが、自分に影響しているものとは違うようだ。
これが現在のコードだ(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)
これでHTTPError: HTTP Error 500: Internal Server Errorが出る。
これはbitcoinの確認済みバグだ。
bitcoinはContent-Lengthヘッダーを必要とするが、いくつかのJSON-RPCライブラリはそれを提供しない。Content-Lengthヘッダーがない場合、bitcoinは500 Internal Server Errorを返す。