serialize writing http requests out to the socket