diff --git a/client/bs_shutdown.py b/client/bs_shutdown.py new file mode 100644 index 0000000..9590958 --- /dev/null +++ b/client/bs_shutdown.py @@ -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) \ No newline at end of file