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'])