Closed infotim closed 8 years ago
server.py
from aiohttp import web from aiohttp_xmlrpc import handler class XMLRPCExample(handler.XMLRPCView): def rpc_test(self): return { 'nested': { 'struct': 'broken', } } app = web.Application() app.router.add_route('*', '/', XMLRPCExample) if __name__ == "__main__": web.run_app(app)
client.py
import asyncio import pprint from aiohttp_xmlrpc.client import ServerProxy loop = asyncio.get_event_loop() client = ServerProxy("http://127.0.0.1:8080/", loop=loop) async def main(): pprint.pprint(await client.test()) client.close() if __name__ == "__main__": loop.run_until_complete(main())
Output from client: {'nested': {'struct': 'broken'}, 'struct': 'broken'}
{'nested': {'struct': 'broken'}, 'struct': 'broken'}
Thank you
I already uploaded a new version into pypi.
server.py
client.py
Output from client:
{'nested': {'struct': 'broken'}, 'struct': 'broken'}