Skip to content

Latest commit

 

History

History
44 lines (28 loc) · 1.01 KB

README.md

File metadata and controls

44 lines (28 loc) · 1.01 KB

async-http2

GitHub Actions PyPI

asyncio-compatible HTTP2 client for Python based on reqwest Rust crate and pyo3/pyo3-asyncio

Installation

pip install async-http2

Usage

import asyncio
import logging

from async_http2 import Client


def main():
    logging.basicConfig(level=logging.INFO, format='%(asctime)-15s %(message)s')

    client = Client(timeout=60)

    loop = asyncio.get_event_loop()
    loop.run_until_complete(work(client))


async def work(client):
    resp_data = await client.get('http://localhost:1010', {
        'fast': '1',
    })
    logging.info(resp_data)


if __name__ == '__main__':
    main()

License

This work is released under the MIT license. A copy of the license is provided in the LICENSE file.