Hello all,
I'd really be thankful for some help in getting my JSON RPC client to actually get to talk to my bitcoin daemon.
Basically, I've been actively trying different JSON client with pretty much the same results... 401 Unauthorized...
I've also tried the Curl based example from the docs which is working as a charm, so I'm really wondering wth i'm doing wrong...
Nothing helpful found in the debug.log (I can re-symlink it to /dev/null now
)
Would anyone be kind enough to have a little look at my code and/or give me a couple of pointers ?
Thank you very much
irb(main):009:0> client = JsonRPC::Client.new("http://admin:passsword@localhost:8332/")
=> #<JsonRPC::Client:0x7ffe29900978 @address=#<Addressable::URI:0x3fff14c8028c URI:http://admin:passsword@localhost:8332/>>
irb(main):010:0> client.request 'getbalance', {}
JSON::ParserError: 705: unexpected token at '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML>
<HEAD>
<TITLE>Error</TITLE>
<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=ISO-8859-1'>
</HEAD>
<BODY><H1>401 Unauthorized.</H1></BODY>
</HTML>
'
from /usr/lib/ruby/gems/1.8/gems/json-1.4.6/lib/json/common.rb:146:in `parse'
from /usr/lib/ruby/gems/1.8/gems/json-1.4.6/lib/json/common.rb:146:in `parse'
from /usr/lib/ruby/gems/1.8/gems/jsonrpc-0.9.2/lib/jsonrpc.rb:20:in `request'
from /usr/lib/ruby/1.8/net/http.rb:543:in `start'
from /usr/lib/ruby/1.8/net/http.rb:440:in `start'
from /usr/lib/ruby/gems/1.8/gems/jsonrpc-0.9.2/lib/jsonrpc.rb:19:in `request'
from (irb):10
Contents of my bitcoin.conf
rpcpassword=password
rpcuser=admin