Skip to content

Commit 3c2f6d7

Browse files
committed
Adjust readme
1 parent 3fec930 commit 3c2f6d7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
Process incoming JSON-RPC requests in Python.
1313

14+
To serve JSON-RPC requests:
1415
```python
1516
from jsonrpcserver import Success, method, serve
1617

@@ -22,6 +23,13 @@ if __name__ == "__main__":
2223
serve()
2324
```
2425

26+
Or use `dispatch`:
27+
```python
28+
>>> from jsonrpcserver import dispatch
29+
>>> dispatch('{"jsonrpc": "2.0", "method": "ping", "id": 1}')
30+
'{"jsonrpc": "2.0", "result": "pong", "id": 1}'
31+
```
32+
2533
Full documentation is at [jsonrpcserver.com](https://www.jsonrpcserver.com/).
2634

2735
See also: [jsonrpcclient](https://github.com/explodinglabs/jsonrpcclient)

0 commit comments

Comments
 (0)