The requests-async package

Hi folks,

I’ve just released https://github.com/encode/requests-async - which is a requests-based asyncio HTTP client.

Couple of things here, firstly I guess some of you might find this useful for making outgoing HTTP requests from Sanic applications.

Secondly, I’m wondering if there’d be any interest in exploring Sanic having a requests-based Test Client based on this, perhaps alongside the existing aiohttp one?

4 Likes

@tomchristie I would love to see an asyncio test client! And I think it’s been asked for multiple times in issues.

I agree. There are a number of places where it has been talked about to replace atiohttp for this purpose.

Thanks again for another solid library.

Grand that’s good to hear.

Side-motivation - if Sanic’s own test suite moved to a requests-based test client, it’d be a little bit easier to then add an ASGI interface, and have the test suite run directly against the ASGI interface.

If anyone wants to take a crack at integrating requests-async into a test client for Sanic that’d be grand. Otherwise I may manage to end up taking a look in a month or so.

On it.

Probably no time this week, but I will start this next week.

1 Like

By this, are you including the new requests-async?

Yes.
You’d have requests-async as the dependency, as an alternative to aiohttp.

1 Like