add ability to auto calculate payload content length