bank-teller.py 358 Bytes
import requests
import json
from pprint import pprint


url = 'http://localhost:7000/rpc'
headers = {'content-type': 'application/json'}
p = {'host': 'pemda'}
data = {
    'method': 'echo',
    'params': [p],
    'jsonrpc': '2.0',
    'id': 0,
    }
resp = requests.post(url, data=json.dumps(data), headers=headers)
json_resp = resp.json()
pprint(json_resp)