I am trying to send a HTTP request to a web-server, I'm really new to this - started yesterday so I'm probs being stupid but everytime I send a request I only get a blank response, here is my python code:
import socket
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(('192.168.0.40', 80))
msg = 'GET /testPy.html HTTP/1.0'
client.send(msg.encode())
response = client.recv(4096)
print(response.decode())
Don't know if it is something with my python or if it is something i need to set up on the webserver, many thanks in advance
my console:
Emilians-MacBook-Pro:python emil$ python tcp.py
Emilians-MacBook-Pro:python emil$
there is around a 10s delay until the newline
when i do not decode the request it prints
Emilians-MacBook-Pro:python emil$ python tcp.py
b''
Emilians-MacBook-Pro:python emil$