Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 554 Bytes

README.md

File metadata and controls

36 lines (26 loc) · 554 Bytes

Fluid JSON-RPC

Turn any function signatures into JSON-RPC requests.

import requests

from fluid import JSONRPC


dispatcher = JSONRPC(url="")
dispatcher.session = requests.Session()

@dispatcher.dispatch(name="methodName")
def method_name(foo: str, bar: int):
    pass

...

result = method_name(foo="value", bar=1)

"""
The call above will make a POST request on the URL with the parameters passed:

{
  "id": 0,
  "jsonrpc": "2.0",
  "method": "methodName",
  "params": {
      "foo": "value",
      "bar": 1
  }
}
"""