I switched to using HTTP/1.0 for now to prevent the server from sending chunked transfer-encoding, which this code currently doesn't support.