import asyncio
import httpx
async def main():
async with httpx.AsyncClient() as client:
resp = await client.get("https://python.org")
http_text = await resp.text()
print(http_text)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter