5 host = 'http://localhost:9888'
8 def post(endpoint, parameter):
9 headers = {'Content-Type': 'application/json'}
11 request = requests.post(host + '/' + endpoint, headers=headers, json=parameter)
12 except Exception as e:
14 + 'Connection error:Make sure bytomd run at http://localhost:9888 before you run this script.')
17 result = json.loads(request.text)
18 if not result['status'] == 'success':
19 print('Server error:' + endpoint + '\n' + result['msg'])