Author Topic: RPC help  (Read 5913 times)

0 Members and 1 Guest are viewing this topic.

Offline HackFisher

  • Hero Member
  • *****
  • Posts: 883
    • View Profile
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline jbutta2k13

  • Full Member
  • ***
  • Posts: 51
    • View Profile
I have the rpc server started but I cannot connect using python and requests....can someone tell me why I am getting this error.  I have no problems conneting python to http server..


ConnectionError: HTTPConnectionPool(host='localhost', port=18332): Max retries exceeded with url: / (Caused by <class 'socket.error'>: [Errno 10061] No connection could be made because the target machine actively refused it)

config.json rpc info

"rpc": {
    "enable": true,
    "rpc_user": "user",
    "rpc_password": "1234",
    "rpc_endpoint": "localhost:18832",
    "httpd_endpoint": "localhost:8801",
    "htdocs": "./htdocs"



python code snippet....

serverURL = 'http://' + rpc_user + ':' + rpc_password + '@localhost:' + str(rpcPort)
headers = {'content-type': 'application/json'}
payload = json.dumps({"method": 'get_info', "jsonrpc": "2.0"})
response = requests.get(serverURL, headers=headers, data=payload)
print(response.json()['result'])

« Last Edit: July 10, 2014, 07:58:35 pm by jbutta2k13 »