0

I used the following code to connect to the bitcoin core client and encountered this error:

bitcoinrpc.authproxy.JSONRPCException: -342: non-JSON HTTP response with '401 Unauthorized' from server

My configuration file: bitcoin.conf is written as follows:

Expose the RPC/JSON API

server=1
rpcbind="127.0.0.1"
rpcport=8332
rpcuser="bitcoin"
rpcpassword="J9JkYnPiXWqgRzg3vAA"

May I ask what caused my code to report an error, and how should I solve this problem?

2
  • This error can depend also from the library/method that you are using to talk with the RPC interface May 18, 2021 at 10:17
  • Why do you wrap stuff on quotes needlessly?
    – Mercedes
    Oct 24, 2021 at 11:47

1 Answer 1

0

There are many things that can be wrong. More details are required, like the code you mentioned.

There is a more thorough discussion on this matter here:

https://bitcoin.stackexchange.com/a/106601/113203

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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