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
You don't follow the HTTP RFC.
0x0d plus 0x0a).Generally, you should always try to use existing HTTP libraries. Although HTTP seems to be a simple protocol (and it is compared to others), it has rather strict syntactic and semantic rules. If you try to implement this yourself, you should have read and understand the relevant parts of RFC 2616 (and related).
Sadly, there are already too many crappy HTTP implementations not following the standards out there making the life for everyone miserable. Save yourself the hassle and use the HTTP libraries of your chosen language.