Receive form data

This commit is contained in:
2025-12-31 15:17:04 +01:00
parent 139b3992d8
commit aeb4bd74d9
3 changed files with 19 additions and 13 deletions

View File

@@ -23,5 +23,17 @@ class GameService:
self.clock_service.stop()
self.detection_service.stop()
def make_move(self) -> tuple[bytes, str]:
return self.detection_service.analyze_single_frame()
def make_move(self) -> None:
try :
frame, fen = self.detection_service.analyze_single_frame()
print(fen)
headers = {'Content-Type': 'image/jpeg'}
body = {'frame': frame, 'fen': fen}
response = requests.post(
"https://192.168.15.125:1880/party/image",
data=body,
headers=headers,
verify=False)
print(response.status_code)
except Exception as e:
print(e)