httpxで非同期リクエストを送る
code:async_example.py
>> import httpx
>> async def request():
... async with httpx.AsyncClient() as client:
>> import asyncio
>> asyncio.run(request())
>> r = asyncio.run(request())
Python 3.9で検証した
async/awaitはasync defの外では使えないっぽい
SyntaxError: 'async with' outside async function
SyntaxError: 'await' outside function