Files
darkfi/scripts/jsonrpc_client.py
2020-12-28 17:05:12 +01:00

24 lines
413 B
Python

import requests
import json
def main():
url = "http://localhost:8000/"
# Example echo method
payload = {
"method": "quit",
"params": [],
"jsonrpc": "2.0",
"id": 0,
}
response = requests.post(url, json=payload).json()
print(response)
#assert response["result"] == "Hello World!"
assert response["jsonrpc"]
if __name__ == "__main__":
main()