set content-length header before sending