Download test_upload.py from ADI576/SecBrief: direct link, hf CLI and curl.
- Browser
- Download file 417 Bytes
-
https://huggingface.co/spaces/ADI576/SecBrief/resolve/main/test_upload.py
- Command line
-
hf download hf://spaces/ADI576/SecBrief/test_upload.py
-
curl -L -o test_upload.py https://huggingface.co/spaces/ADI576/SecBrief/resolve/main/test_upload.py
417 Bytes
| import httpx | |
| import json | |
| url = "http://localhost:8000/api/parse-upload" | |
| files = {'file': ('test.sarif', open('test.sarif', 'rb'), 'application/json')} | |
| try: | |
| with httpx.Client() as client: | |
| response = client.post(url, files=files, timeout=30.0) | |
| response.raise_for_status() | |
| result = response.json() | |
| print(json.dumps(result, indent=2)) | |
| except Exception as e: | |
| print(f"Error: {e}") | |