add: client

This commit is contained in:
2026-02-24 12:47:07 +00:00
parent a71f3f3681
commit 9958763f6f

24
client/bs_shutdown.py Normal file
View File

@@ -0,0 +1,24 @@
import urllib.request
import json
import socket
machine_name = socket.gethostname()
url = "http://192.168.50.27:5000/lookup"
payload = {
"name": machine_name,
}
data = json.dumps(payload).encode("utf-8")
req = urllib.request.Request(
url,
data=data,
method="POST"
)
with urllib.request.urlopen(url, timeout=10) as response:
data = response.read()
json_data = json.loads(data)
print(json_data)