Spaces:
Sleeping
Sleeping
Download app/services/http_client.py from Gowthamr23/fast-api-cloud: direct link, hf CLI and curl.
- Browser
- Download file 288 Bytes
-
https://huggingface.co/spaces/Gowthamr23/fast-api-cloud/resolve/main/app/services/http_client.py
- Command line
-
hf download hf://spaces/Gowthamr23/fast-api-cloud/app/services/http_client.py
-
curl -L -o http_client.py https://huggingface.co/spaces/Gowthamr23/fast-api-cloud/resolve/main/app/services/http_client.py
288 Bytes
| import httpx | |
| http_client: httpx.AsyncClient | None = None | |
| async def init_http_client(): | |
| global http_client | |
| http_client = httpx.AsyncClient() | |
| async def close_http_client(): | |
| global http_client | |
| if http_client: | |
| await http_client.aclose() | |
| http_client = None | |