3

I am attempting to access bitcoind's http-json-rpc api thru firefox. I enter the following URL

http://user:password@localhost:8332/getinfo

and it returns

There was an error parsing the JSON document. The document may not be well-formed.
Document contents:

So the document contents are empty, but when I inspect element and look at the response, I get

Status-code: 404 Not Found
Connection: Close
Content-Type: "application/json"
Server: "bitcoin-json-rpc/v0.8.2-815-g5f083af-beta"

So the server is replying, but doesn't recognize the request or something.

My bitcoin.conf file reads

rpcuser=user
rpcpassword=password
rpcport=8332

If I do

 http://user:password@localhost:8332/

instead, it gives me a 500 Internal Server Error

Any idea what is missing?

1

You need to POST the request according to the JSON RPC specifications. So this will not work using Firefox without any special extension that lets you set POST information. You cannot simply request the page http://user:password@localhost:8332/getinfo and expect bitcoind to return the getinfo. There is no page system, it's not a normal www-server (i.e. pages hyperlinked together), it just uses the HTTP protocol to transport JSON. As long as you make that POST request correctly, I don't think it mattes what page you call.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.