chrithccmc
chrithccmc

Reputation: 1069

Json RPC Python Client

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

Upvotes: 7

Views: 17022

Answers (4)

jayesh
jayesh

Reputation: 3655

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')

Upvotes: 0

Kirill Pavlov
Kirill Pavlov

Reputation: 124

Also there is json-rpc library, it supports python2.7, python3.2+, does not have dependencies and it`s protocol independent.

Upvotes: 2

Jakob Simon-Gaarde
Jakob Simon-Gaarde

Reputation: 725

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

Upvotes: 1

ars
ars

Reputation: 123558

See json-rpc for python.

Upvotes: 4

Related Questions