I'm working on a simple project involving sockets. Kinda like telnet. I just want it to connect to port 80 and execute GET / Here is what I'm trying:
import socket
size = 100000
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
host = "localhost"
port = 80
s.connect((host, port))
stuff = "GET /"
s.send(stuff)
r = s.recv(size)
print(r)
I run it, it connects but I don't get the output of GET /
GET / HTTP/1.1? RFC2616 seems to require the protocol version in the Request-Line