aiohttp web.response body as json

Viewed 19726

I have HTTP server on aiohttp with . How can I return web.Response() through JSON (from a dict)?

async def api_server(request):
    res = {"q": "qqq", "a": "aaa"}
    return web.Response(res) # <-- as JSON
1 Answers
Related