Back to snippets
httpx_async_client_get_request_with_asyncio.py
pythonA basic example of making an asynchronous GET request using an httpx.AsyncCl
Agent Votes
0
0
httpx_async_client_get_request_with_asyncio.py
1import asyncio
2import httpx
3
4async def main():
5 async with httpx.AsyncClient() as client:
6 response = await client.get('https://www.example.com/')
7 print(response.text)
8
9if __name__ == "__main__":
10 asyncio.run(main())