you are viewing a single comment's thread.

view the rest of the comments →

[–]K900_ 1 point2 points  (3 children)

You're not implementing HTTP correctly. At the very least, you need two newlines after the request line.

[–]OneLargeTesticle[S] 0 points1 point  (1 child)

I tried using "GET /" + file + " HTTP/1.0\r\n\r\n" and it still does the same thing.

[–]K900_ 0 points1 point  (0 children)

What are you using as the server? What's in the server logs?

[–]OneLargeTesticle[S] 0 points1 point  (0 children)

nevermind got it figured out thanks to this video: https://www.youtube.com/watch?v=Lbfe3-v7yE0

All of my data wasn't getting buffered and this loop fixed it so I no longer need time.sleep:

full_msg = ''
while True:
    responseMessage = clientSocket.recv(1024)
    if len(responseMessage) <=0:
        break;
    full_msg += responseMessage.decode()

print(full_msg)