rlittlefield / aiorequests

requests wrapper for asyncio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

aiorequests

requests wrapper for asyncio (based on run_in_executor).

Reasons

  • aiohttp have no https proxy support.

Features

Usage

import asyncio

import aiorequests


async def yoba():

    r = await aiorequests.get("https://google.com")
    print(r.status_code)
    print(len(r.content))


if __name__ == "__main__":

    loop = asyncio.get_event_loop()
    aiorequests.set_async_requests(loop=loop)
    loop.run_until_complete(yoba())

About

requests wrapper for asyncio


Languages

Language:Python 100.0%