Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 57868 invoked from network); 21 Dec 2005 17:10:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Dec 2005 17:10:34 -0000 Received: (qmail 40749 invoked by uid 500); 21 Dec 2005 17:10:21 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 40660 invoked by uid 500); 21 Dec 2005 17:10:17 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 40581 invoked by uid 99); 21 Dec 2005 17:10:13 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Dec 2005 09:10:13 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [80.74.144.174] (HELO uml24.umlhosting.ch) (80.74.144.174) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Dec 2005 09:10:06 -0800 Received: from oleg by uml24.umlhosting.ch with local (Exim 4.50) id 1Ep7TB-000122-Sa for commons-user@jakarta.apache.org; Wed, 21 Dec 2005 18:09:41 +0100 Date: Wed, 21 Dec 2005 18:09:41 +0100 From: Oleg Kalnichevski To: commons-user@jakarta.apache.org Subject: Re: [HttpClient] How to output the http request body? Message-ID: <20051221170941.GA3951@uml24.umlhosting.ch> Mail-Followup-To: commons-user@jakarta.apache.org References: <20051221134615.29300.qmail@web30010.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051221134615.29300.qmail@web30010.mail.mud.yahoo.com> User-Agent: Mutt/1.5.9i X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Wed, Dec 21, 2005 at 05:46:15AM -0800, qiang zhou wrote: > But request onle have getInputStream() method. If you want output request body, then > > InputStream in = request.getInputStream(); > byte[] bytes = new byte[1024]; > while(in.read(bytes)!=-1) { > //output content. > } > > > ----- Original Message ---- > From: Xiaobo Yang > To: commons-user@jakarta.apache.org > Sent: 2005???12???20??? 7:47:28 > Subject: [HttpClient] How to output the http request body? > > > Hi, > > I managed to output the http request head by adding a println statement in > HttpConnection.java (write method). When I tried to output the http request > body, I found it to be a OutputStream object. Could anybody tell me how to > print out the http request body? Also I wonder how to output the http > response for debugging purpose. Thanks in advanced. > > Regards, > Xiaobo Yang > Is there any particular reason why you do not want to be using the wire logging? http://jakarta.apache.org/commons/httpclient/logging.html Oleg > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org