The requests-async package


#1

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?


#2

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


#3

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.


#4

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.


#5

On it.

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


#6

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


#7

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