Return-Path: Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: (qmail 43167 invoked from network); 24 Mar 2009 03:22:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Mar 2009 03:22:29 -0000 Received: (qmail 76120 invoked by uid 500); 24 Mar 2009 03:22:27 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 76000 invoked by uid 500); 24 Mar 2009 03:22:27 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 75990 invoked by uid 99); 24 Mar 2009 03:22:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Mar 2009 03:22:27 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of subwiz@gmail.com designates 209.85.146.179 as permitted sender) Received: from [209.85.146.179] (HELO wa-out-1112.google.com) (209.85.146.179) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Mar 2009 03:22:19 +0000 Received: by wa-out-1112.google.com with SMTP id v27so1372923wah.22 for ; Mon, 23 Mar 2009 20:21:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=w3KctFbdE1azMm4fzDNVvNHFhQV2F5/HpneBFu2EALo=; b=j2HP3EEVufsHwc7awma8SW87LmiFXxAT4aEVGswyE9cCLDGU5SPAS93t0DWE5GF1Xn 3o5iOnIw85fTTV/Id5YiDEEGqgGcDbZp4fNycYjkBNFdCqBewxX1LiY228/wW9qgbJnO PQq4eX1MA7rx07JEsFo4p/Wq2gvugTzKU68mw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=kjwsLwz7Hw3ZO26XQ4A8inGZnnF5QNpZP0sYIikDGSt7tNM4mBIysNfRj57xgt+rKR RH5QV7mKe/d2l/IUJjdOhUbZwrigjwF5BXLraWhALwvzlT3WQ/dqwAvIvcBC3xHkMnxG 4l1XUinvtoo//O5I0A+JV+fWOWJwMFkVJth2U= MIME-Version: 1.0 Received: by 10.115.23.19 with SMTP id a19mr5274666waj.63.1237864918077; Mon, 23 Mar 2009 20:21:58 -0700 (PDT) Date: Tue, 24 Mar 2009 08:51:58 +0530 Message-ID: <91ae21990903232021t3cd3d99dpeb1bf812c7fe123b@mail.gmail.com> Subject: Http Multi-part exception when using InputStreamBody From: Subhash Chandran To: HttpClient User Discussion Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org We are getting this Exception: Exception in thread "main" org.apache.http.client.ClientProtocolException at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:557) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465) at it.sella.iq.Main.main(Main.java:63) Caused by: org.apache.http.client.NonRepeatableRequestException: Cannot retry request with a non-repeatable request entity at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:402) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555) ... 3 more when we are trying to send Multi-part messages like this: File f = ...; DefaultHttpClient httpclient = new DefaultHttpClient(); MultipartEntity entity = new MultipartEntity(); entity.addPart("file", new InputStreamBody(new FileInputStream(f), f.getName())); We tried adding: httpclient.setHttpRequestRetryHandler(new DefaultHttpRequestRetryHandler(0, false)); This also does not help. How do we fix this? Additional Info: when we are using FileBody instead of InputStreamBody, the code is working fine. -- Regards, Subhash Chandran S http://indiwiz.com/ http://code.google.com/p/rest-client/ --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org For additional commands, e-mail: httpclient-users-help@hc.apache.org