Skip to content

Commit 5443094

Browse files
authored
Switch START/STOP requests to PUT for Fess versions above 14, retaining POST for older versions. (#18)
1 parent bafca5e commit 5443094

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/fessctl/api/client.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,14 @@ def send_request(
8787
url, headers=headers, params=params, timeout=self.timeout
8888
)
8989
elif action == Action.START or action == Action.STOP:
90-
response = httpx.post(
91-
url, headers=headers, json=json_data, params=params, timeout=self.timeout
92-
)
90+
if self._major_version <= 14:
91+
response = httpx.post(
92+
url, headers=headers, json=json_data, params=params, timeout=self.timeout
93+
)
94+
else:
95+
response = httpx.put(
96+
url, headers=headers, json=json_data, params=params, timeout=self.timeout
97+
)
9398
else:
9499
raise ValueError("Invalid action specified")
95100
except httpx.RequestError as e:

0 commit comments

Comments
 (0)