Spaces:
Running
Running
Download test_api.py from Peenjeee/bogor-xplore-api: direct link, hf CLI and curl.
- Browser
- Download file 356 Bytes
-
https://huggingface.co/spaces/Peenjeee/bogor-xplore-api/resolve/main/test_api.py
- Command line
-
hf download hf://spaces/Peenjeee/bogor-xplore-api/test_api.py
-
curl -L -o test_api.py https://huggingface.co/spaces/Peenjeee/bogor-xplore-api/resolve/main/test_api.py
356 Bytes
| import requests | |
| import json | |
| url = "http://localhost:5000/api/recommendations" | |
| payload = {"place_id": 10, "top_n": 5} | |
| headers = {"Content-Type": "application/json"} | |
| try: | |
| response = requests.post(url, json=payload, headers=headers) | |
| print(f"Status: {response.status_code}") | |
| print(response.json()) | |
| except Exception as e: | |
| print(f"Error: {e}") | |