Skip to content

Commit

Permalink
Adjust examples documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
bcb committed Sep 14, 2016
1 parent 731e496 commit 6dad231
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions doc/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ jsonrpcclient Examples
Sending JSON-RPC requests in Python using various frameworks and transport
protocols.

.. contents::
:local:

Requests
========

Expand All @@ -23,25 +26,6 @@ Uses the `Requests <http://docs.python-requests.org/>`__ library.
<-- {"jsonrpc": "2.0", "result": "pong", "id": 1}
'pong'

ZeroMQ
======

Uses `pyzmq <https://pyzmq.readthedocs.io/>`__.

::

$ pip install jsonrpcclient pyzmq

::

>>> from jsonrpcclient.zmq_client import ZMQClient
>>> ZMQClient('tcp://localhost:5000').request('ping')
--> {"jsonrpc": "2.0", "method": "ping", "id": 1}
<-- {"jsonrpc": "2.0", "result": "pong", "id": 1}
'pong'

See `blog post <https://bcb.github.io/jsonrpc/pyzmq>`__.

Tornado
=======

Expand Down Expand Up @@ -78,3 +62,22 @@ request.
pong

See `blog post <https://bcb.github.io/jsonrpc/tornado>`__.

ZeroMQ
======

Uses `pyzmq <https://pyzmq.readthedocs.io/>`__.

::

$ pip install jsonrpcclient pyzmq

::

>>> from jsonrpcclient.zmq_client import ZMQClient
>>> ZMQClient('tcp://localhost:5000').request('ping')
--> {"jsonrpc": "2.0", "method": "ping", "id": 1}
<-- {"jsonrpc": "2.0", "result": "pong", "id": 1}
'pong'

See `blog post <https://bcb.github.io/jsonrpc/pyzmq>`__.

0 comments on commit 6dad231

Please sign in to comment.