7

What is the easy way to making json rpc call from python?

Rupesh Yadav
  • 12,096
  • 4
  • 53
  • 70
chrithccmc
  • 1,069
  • 4
  • 14
  • 17

4 Answers4

4

See json-rpc for python.

ars
  • 120,335
  • 23
  • 147
  • 134
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)

Javascript client

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