You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
403 B
18 lines
403 B
# -*- coding: utf-8 -*-
|
|
import httpx
|
|
import asyncio
|
|
|
|
|
|
async def async_get_example():
|
|
async with httpx.AsyncClient() as client:
|
|
response = await client.get('https://httpbin.org/get')
|
|
print(f"Status Code: {response.status_code}")
|
|
print(f"Response Content: {response.text}")
|
|
|
|
|
|
async def main():
|
|
await async_get_example()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|
|
|