Spaces:
Build error
Build error
File size: 757 Bytes
36a599e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
import requests
import json
def test_api():
url = "https://zorba11--ui-coordinates-finder-fastapi-app.modal.run/process"
headers = {
'Accept': 'application/json',
}
try:
files = {
'file': ('screen-1.png', open('/Users/zorba11/Desktop/screen-1.png', 'rb'), 'image/png')
}
response = requests.post(
url,
files=files,
headers=headers
)
print(f"Status Code: {response.status_code}")
print(f"Response Headers: {dict(response.headers)}")
print(f"Response Content: {response.content.decode()}")
except Exception as e:
print(f"Error: {str(e)}")
if __name__ == "__main__":
test_api() |