beta.quicklistp.org
works only when the client uses Server Name Indication (SNI) while quicklistp.org
from your working example does not need SNI.HTTP/1.1
request but don't have the ability to handle HTTP/1.1
responses like chunked encoding properly. For simply requests like yours I would recommend to use HTTP/1.0
only. Also your code expects the server to close the connection after the data transfer is done, i.e. you don't extract body size from HTTP header and read only the given number of bytes. Using Connection: keep-alive
in this situation is a bad idea because this way you ask the server to keep the connection open after the body is sent. Also Connection: keep-alive
is implicit when using HTTP/1.1
anyway.