So the standard says each new line should end with \r\n
and each request should end with \r\n\r\n
What, at the bare minimum, is required for an HTTP request?
But most servers will handle leading newlines of most types
printf '\rGET / HTTP/1.1\r\nHost: www.example.com\r\nConnection: close\r\n\r\n' |
nc www.example.com 80
printf '\r\nGET / HTTP/1.1\r\nHost: www.example.com\r\nConnection: close\r\n\r\n' |
nc www.example.com 80
printf '\r\r\nGET / HTTP/1.1\r\nHost: www.example.com\r\nConnection: close\r\n\r\n' |
nc www.example.com 80
printf '\n\rGET / HTTP/1.1\r\nHost: www.example.com\r\nConnection: close\r\n\r\n' |
nc www.example.com 80
About being valid or not, lot of the stuff on net is 100% compliant with RFC standards. You can also see
https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol
So a space would create a problem at start but many of the servers would remove leading blank new lines