Return-Path: Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 87147 invoked from network); 8 Aug 2003 18:04:19 -0000 Received: from main.gmane.org (80.91.224.249) by daedalus.apache.org with SMTP; 8 Aug 2003 18:04:19 -0000 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19lBal-0008Lp-00 for ; Fri, 08 Aug 2003 20:03:55 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: commons-user@jakarta.apache.org Received: from news by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19lBak-0008Le-00 for ; Fri, 08 Aug 2003 20:03:54 +0200 From: Oliver Geisser Subject: Re: PutMethod with chunked transfer Date: Fri, 08 Aug 2003 20:04:14 +0200 Lines: 28 Message-ID: References: <10667.1060172272@www60.gmx.net> <3F32DEC3.14138.131C12@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@main.gmane.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: de-de, en-us, en In-Reply-To: <3F32DEC3.14138.131C12@localhost> Sender: news X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi Andreas Probst wrote: > Hi, > > I found the solution, when I debugged through the code again: > > To run unbuffered, ie. streamed, set requestContentLength to -1 > or the real content length. -1 means chunked. If it isn't set by > the caller, it's set to -2 by default, which results i running > buffered. > > The code now looks like: > > putMethod.setRequestBody(inputStream); > putMethod.setRequestContentLength(...); > _jakartaHttpClient.executeMethod(putMethod); [...] Exactly, but you should use constant definitions and not hardcoded number values. Use: putMethod.setRequestContentLength(PutMethod.CONTENT_LENGTH_CHUNKED); Olli --og