Spaces:
Runtime error
Runtime error
Download TechdocsAPI/backend/services/auth/utils/functools.py from CaffeineCrew/Techdocs: direct link, hf CLI and curl.
- Browser
- Download file 350 Bytes
-
https://huggingface.co/spaces/CaffeineCrew/Techdocs/resolve/8c7f1c1adcfce53c52bb24efdd974747e01034b6/TechdocsAPI/backend/services/auth/utils/functools.py
- Command line
-
hf download hf://spaces/CaffeineCrew/Techdocs@8c7f1c1adcfce53c52bb24efdd974747e01034b6/TechdocsAPI/backend/services/auth/utils/functools.py
-
curl -L -o functools.py https://huggingface.co/spaces/CaffeineCrew/Techdocs/resolve/8c7f1c1adcfce53c52bb24efdd974747e01034b6/TechdocsAPI/backend/services/auth/utils/functools.py
350 Bytes
| import requests | |
| from typing import Any, Dict | |
| import json | |
| def post_request(url: str, data: Dict[str, Any], headers: Dict[str, str]=None): | |
| json_data = json.dumps(data) | |
| headers = {'Content-type': 'application/json', 'Accept': 'application/json'} | |
| response = requests.post(url, data=json_data, headers=headers) | |
| return response.status_code |