adding features

This commit is contained in:
DioCrafts
2025-03-26 19:08:07 +01:00
parent e22c0ac855
commit dacc3ecc4c
37 changed files with 456 additions and 60 deletions
+31
View File
@@ -0,0 +1,31 @@
#!/usr/bin/env python3
import requests
import os
import json
file_path = "./test-api-file.txt"
url = "http://localhost:8086/api/files/upload"
# Check file existence
if not os.path.exists(file_path):
print(f"Error: File not found at {file_path}")
exit(1)
# Create multipart form
files = {'file': open(file_path, 'rb')}
# Make request
try:
response = requests.post(url, files=files)
print(f"Status Code: {response.status_code}")
print("Response Headers:")
for key, value in response.headers.items():
print(f"{key}: {value}")
print("\nResponse Content:")
try:
data = response.json()
print(json.dumps(data, indent=2))
except:
print(response.text)
except Exception as e:
print(f"Error: {e}")