Files
invoice-master/test_api.py
Yaojia Wang dafa86c588 Init
2025-10-26 20:41:11 +01:00

15 lines
439 B
Python

import requests
import json
# Test the API with the problematic invoice
url = "http://127.0.0.1:8000/extract_invoice/"
file_path = r"data\processed_images\4BC5E5B3-E561-4A73-BC9C-46D4F08F89C3.png"
with open(file_path, 'rb') as f:
files = {'file': f}
response = requests.post(url, files=files)
print("Status Code:", response.status_code)
print("\nResponse JSON:")
print(json.dumps(response.json(), indent=2, ensure_ascii=False))