#!/usr/bin/env python import json import jsonrpc import requests #url = "http://user:[email protected]:port/ #you can find user and password in multichain.conf file in path ~/.multichain/chain2 url = "http://multichainrpc:[email protected]:4352/" headers = {‘content-type‘: ‘application/json‘} helpload = { "jsonrpc":"1.0", "method": "getinfo", } print "------ test begin --------" response = requests.post(url, data=json.dumps(helpload), headers=headers).json() print response
时间: 2024-10-05 22:56:09