Add changing cars
This commit is contained in:
@@ -166,15 +166,17 @@ class Handler(BaseHTTPRequestHandler):
|
||||
import json
|
||||
try:
|
||||
data = json.loads(body)
|
||||
print("Received cars:", data)
|
||||
success, message = update_cars(data.get("cars", []))
|
||||
return True
|
||||
except json.JSONDecodeError:
|
||||
self.send_response(400)
|
||||
self.send_header("Content-Type", "application/json")
|
||||
self.end_headers()
|
||||
self.wfile.write(b'{"error":"invalid json"}')
|
||||
return
|
||||
print("Invalid JSON received")
|
||||
return False
|
||||
|
||||
print("Received cars:", data)
|
||||
|
||||
def send_image(self, img_path: str):
|
||||
if os.path.exists(img_path):
|
||||
|
||||
Reference in New Issue
Block a user