Send JSON-RPC requests
Project description
Send JSON-RPC requests in Python 2.7 and 3.3+.
>>> HTTPServer('http://pets.com/api').request('cat')
'meow'
Full documentation is available at https://jsonrpcclient.readthedocs.org/.
Recent Changes
2.0.1 (2015-09-04)
A major update, which makes way for protocols other than just HTTP.
Importantly, the Server class has been renamed HTTPServer. Adjust your code like this:
>>> from jsonrpcclient.http_server import HTTPServer
>>> server = HTTPServer('http://example.com/api')
The requests module, which is required to send requests over HTTP, will no longer be installed as a dependency. It’s now up to the user to install it like this:
$ pip install jsonrpcclient requests
Three exceptions have been removed: InvalidRequest (out of scope), InvalidResponse (catch jsonschema.ValidationError instead) and ConnectionError (catch the requests module exceptions instead).
Faster validation of response messages.
Requests are now sent and logged with the JSON-RPC parts in the right order, (beginning with 'jsonrpc': 2.0' etc.), which is just nicer to read.
ZeroMQ support added.
Documentation overhauled.
Other fixes and improvements.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.