From 7d83ca9e93a0e4c90cac69f6286e9f60619abd8f Mon Sep 17 00:00:00 2001 From: Shinsuke Sugaya Date: Thu, 14 Aug 2025 10:20:39 +0900 Subject: [PATCH] Switch START/STOP requests to PUT for Fess versions above 14, retaining POST for older versions. --- src/fessctl/api/client.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/fessctl/api/client.py b/src/fessctl/api/client.py index 1292349..50c64e8 100644 --- a/src/fessctl/api/client.py +++ b/src/fessctl/api/client.py @@ -87,9 +87,14 @@ def send_request( url, headers=headers, params=params, timeout=self.timeout ) elif action == Action.START or action == Action.STOP: - response = httpx.post( - url, headers=headers, json=json_data, params=params, timeout=self.timeout - ) + if self._major_version <= 14: + response = httpx.post( + url, headers=headers, json=json_data, params=params, timeout=self.timeout + ) + else: + response = httpx.put( + url, headers=headers, json=json_data, params=params, timeout=self.timeout + ) else: raise ValueError("Invalid action specified") except httpx.RequestError as e: