Update 'states/_modules/syncthing.py'

This commit is contained in:
Paul 2021-06-17 10:06:44 +02:00
parent 538e5e9b8d
commit fddceb4459

View File

@ -63,7 +63,8 @@ def insync(url, verify, apikey):
def restart(url, verify, apikey): def restart(url, verify, apikey):
fullurl = f"{url}/rest/system/restart" fullurl = f"{url}/rest/system/restart"
try: try:
req = requests.post(fullurl, req = requests.request("post",
fullurl,
verify=verify, verify=verify,
headers={"X-API-Key": apikey}) headers={"X-API-Key": apikey})
except (requests.exceptions.RequestException) as exc: except (requests.exceptions.RequestException) as exc: