use byteLength when calculating content-length