Skip to main content

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

This version

2.0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jsonrpcclient-2.0.1.tar.gz (6.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page