forked from mirrors/gecko-dev
Update `aiohttp` to version 3.8.5 and `requests` to version 2.31.0, and vendor their respective dependencies. Add all the new dependencies to the various required site virtualenv requirements files. Differential Revision: https://phabricator.services.mozilla.com/D188904
22 lines
489 B
Python
Executable file
22 lines
489 B
Python
Executable file
#!/usr/bin/env python3
|
|
import asyncio
|
|
|
|
import aiohttp
|
|
|
|
|
|
async def fetch(session: aiohttp.ClientSession) -> None:
|
|
print("Query http://httpbin.org/get")
|
|
async with session.get("http://httpbin.org/get") as resp:
|
|
print(resp.status)
|
|
data = await resp.json()
|
|
print(data)
|
|
|
|
|
|
async def go(loop):
|
|
async with aiohttp.ClientSession(loop=loop) as session:
|
|
await fetch(session)
|
|
|
|
|
|
loop = asyncio.get_event_loop()
|
|
loop.run_until_complete(go(loop))
|
|
loop.close()
|