When I send a normal HTTP request via a socket, the server does not respond with an OK response. I copied the HTTP header from Firefox. Here is the code:
Soc
The correct fix which really works and it is cross platform:
pw.print("GET / HTTP/1.1\r\n"); pw.print("Host: stackoverflow.com\r\n\r\n");