API/CC3.2.py

15 lines
306 B
Python
Raw Permalink Normal View History

import socket
import json
s = socket.socket()
s.connect(("localhost", 8889))
print("connected")
s.sendall(json.dumps({
"type": "register",
"username": 1145,
"password": 514
}).encode())
print("sended")
response = s.recv(1024)
print("rcved")
result = json.loads(response.decode())
print (result)