Pybites Logo

Async http client

Level: Intermediate (score: 3)

Your task in this Bite is to create an http client that will asynchronously send http requests and process responses.

This Bite is focused on using asyncio, so you are expected to write async function.

To demonstrate power of asynchronous requests you will have to implement function that is able to send 100 requests and get results in 0.5 seconds, despite the fact that each request will take around 0.1 second for the server to respond to!

This is impossible without concurrent requests. (The test server is able to handle concurrent requests.)

For a detailed task description read the docstrings of the function that you are supposed to implement: get_results_from_urls.

Useful links

- Python docs: asyncio — Asynchronous I/O

AIOHTTP docs

- Async IO in Python: A Complete Walkthrough