compute content-length for form submission