set POST Content-Length when appropriate