Reputation: 3359
This works just fine.
sock.send("GET / HTTP/1.0%s" % (CRLF))
When I use this one google replies by telling me the client sent a malformed request.
sock.send("GET {0} HTTP/ {1}".format(path, CRLF))
Upvotes: 0
Views: 39
Reputation: 4549
You're missing the HTTP version in the second:
"GET {0} HTTP/ {1}"
should be
"GET {0} HTTP/1.0 {1}"
You also may need to remove the trailing space.
Upvotes: 1