Spaces:
Runtime error
Runtime error
Download backend/test_api.py from Mayank11207/scamdetect-backend: direct link, hf CLI and curl.
- Browser
- Download file 316 Bytes
-
https://huggingface.co/spaces/Mayank11207/scamdetect-backend/resolve/main/backend/test_api.py
- Command line
-
hf download hf://spaces/Mayank11207/scamdetect-backend/backend/test_api.py
-
curl -L -o test_api.py https://huggingface.co/spaces/Mayank11207/scamdetect-backend/resolve/main/backend/test_api.py
316 Bytes
| import requests | |
| url = "http://localhost:8000/api/scan/text" | |
| payload = {'text': 'Congratulations! You won the lottery.', 'ephemeral': 'false'} | |
| try: | |
| response = requests.post(url, data=payload) | |
| print("Status:", response.status_code) | |
| print("Response:", response.json()) | |
| except Exception as e: | |
| print(e) | |