Skip to content

MtkN1/aiohttp-client

Repository files navigation

aiohttp-client

This module wraps aiohttp.ClientSession so that it can be used with APIs such as:

  1. HTTP request
    import aiohttp_client
    
    async with aiohttp_client.Client() as client:
        r = await client.get("https://httpbin.org/get")  # without "async with"
        print(r.json())  # without "await"
  2. HTTP request (Stream)
    import aiohttp_client
    
    async with aiohttp_client.Client() as client:
        async with client.stream("GET", "https://httpbin.org/get") as resp:  # aiohttp conventional API
            print(await resp.json())
  3. 🚧 WIP: WebSocket
    import aiohttp_client
    
    async with aiohttp_client.Client() as client:
        async for ws in client.ws_connect("wss://echo.websoket.events"):  # Reconnection
            print(await ws.recv())

The purpose of this API is to...

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages