import socket
connect_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connect_socket.connect(('127.0.0.1', 54805))
connect_socket.send(b"""HTTP/1.1 GET /somepage\r\n""")
24
connect_socket.recv(1024)
b'HTTP/1.1 200 OK\nContent-type: text/html\n\n<html>\n<body>\n<h1> hello, world </h1>\n</body>\n</html>\n'
print(_.decode('utf8'))
HTTP/1.1 200 OK Content-type: text/html <html> <body> <h1> hello, world </h1> </body> </html> HTTP/1.1 200 OK Content-type: text/html <html> <body> <h1> hello, world </h1> </body> </html>