What is the easy way to making json rpc call from python?
Asked
Active
Viewed 1.7k times
7
-
See http://stackoverflow.com/questions/4738209/python-twisted-json-rpc. It has some example code. – brent.payne Mar 13 '12 at 05:13
4 Answers
4
See json-rpc for python.

ars
- 120,335
- 23
- 147
- 134
-
1The example on that link is out of date. See @pavlof99's answer for the latest docs – BobTuckerman Jul 21 '16 at 15:27
2
Also there is json-rpc library, it supports python2.7, python3.2+, does not have dependencies and it`s protocol independent.

Kirill Pavlov
- 124
- 1
- 6
1
json-wsp (implemented in Ladon) has a python client and a javascript client for browsers.
Ladon (Supports both python 2 and 3)
Python client (Python client can be used from shell too)

Jakob Simon-Gaarde
- 675
- 8
- 26
0
you need to create server and client script. and you have to provide JSONRPCResponseManager and dispatcher.
from jsonrpc import JSONRPCResponseManager, dispatcher
something like @Request.application def application(request): # Dispatcher is dictionary {: callable} dispatcher["Hi"] = lambda s: s
response = JSONRPCResponseManager.handle(
request.data, dispatcher)
return Response(response.json, mimetype='application/json')

jayesh
- 3,277
- 1
- 18
- 7