async-mgun

HTTP REST Client based on aiohttp with dynamic url building


Keywords
http, client, rest, aiohttp, async, request, mgun
License
MIT
Install
pip install async-mgun==0.1.3

Documentation

async-mgun

HTTP REST Client based on aiohttp with dynamic url building. Useful for microservices non-blocking communication

Install

pip install async-mgun

Quickstart

from mgun import HttpClient
import asyncio

client = HttpClient('https://httpbin.org')


async def request():
    resp = await client.anything.api.users[23].address.get({'q': '12'})

    print(resp.status)  # 200
    print(resp.data['url'])  # https://httpbin.org/anything/api/users/23/address?q=12

loop = asyncio.get_event_loop()
loop.run_until_complete(asyncio.wait([request()]))