commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xiaobo Yang <xiaobo.y...@gmail.com>
Subject Re: [HttpClient] How to output the http request body?
Date Wed, 21 Dec 2005 17:33:30 GMT
Thanks for all your kind replies. Now I managed to get the http request
printed out. What I am doing now is to check the webdav request and finally
I found it is related to jakarta slide. In slide, some classes are
overwritten.

On 12/21/05, Oleg Kalnichevski <olegk@apache.org> wrote:
>
> 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 <xiaobo.yang@gmail.com>
> > 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
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message