jsonrpc_client.py 444 B

123456789101112131415161718192021222324
  1. import requests
  2. import json
  3. def main():
  4. url = "http://localhost:8000/"
  5. # Example echo method
  6. payload = {
  7. "method": "stop",
  8. #"method": "get_info",
  9. "params": [],
  10. "jsonrpc": "2.0",
  11. "id": 0,
  12. }
  13. response = requests.post(url, json=payload).json()
  14. print(response)
  15. #assert response["result"] == "Hello World!"
  16. assert response["jsonrpc"]
  17. if __name__ == "__main__":
  18. main()