protected void initConnection(Object connection) { contentLength = calculateContentLength(); addRequestHeader("Content-Length", Long.toString(contentLength)); super.initConnection(connection); }