You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Ju...@HS-Karlsruhe.de on 2009/08/05 15:40:15 UTC
How to get error stream ?
Using plain java.net I can use this sequence to obtain an error message
submitted by the HTTP server:
HttpURLConnection conn = ...;
conn.connect();
InputStream inputStream = conn.getErrorStream();
How can I get an InputStream representing the error stream when I'm using
HttpComponents?
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: How to get error stream ?
Posted by Oleg Kalnichevski <ol...@apache.org>.
On Fri, Aug 07, 2009 at 09:14:29AM -0700, Adrian Cole wrote:
> It does help that you designed this way... two separate streams add
> unnecessary complexity!
>
Lots, lots and lots of pain using HttpURLConnection helped.
Cheers
Oleg
> Cheers,
> -Adrian
> jclouds
>
> On Fri, Aug 7, 2009 at 7:05 AM, Oleg Kalnichevski <ol...@apache.org> wrote:
>
> > On Wed, Aug 05, 2009 at 03:40:15PM +0200,
> > Juergen.Zimmermann@HS-Karlsruhe.de wrote:
> > > Using plain java.net I can use this sequence to obtain an error message
> > > submitted by the HTTP server:
> > > HttpURLConnection conn = ...;
> > > conn.connect();
> > > InputStream inputStream = conn.getErrorStream();
> > >
> > > How can I get an InputStream representing the error stream when I'm using
> > > HttpComponents?
> > >
> > >
> >
> > HttpCore does not support the concept of an error stream. One should use
> > HttpEntity#getContent to obtain the response data stream regardless of the
> > HTTP
> > response status.
> >
> > Hope this helps
> >
> > Oleg
> >
> >
> >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> > > For additional commands, e-mail: httpclient-users-help@hc.apache.org
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> > For additional commands, e-mail: httpclient-users-help@hc.apache.org
> >
> >
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: How to get error stream ?
Posted by Adrian Cole <fe...@gmail.com>.
It does help that you designed this way... two separate streams add
unnecessary complexity!
Cheers,
-Adrian
jclouds
On Fri, Aug 7, 2009 at 7:05 AM, Oleg Kalnichevski <ol...@apache.org> wrote:
> On Wed, Aug 05, 2009 at 03:40:15PM +0200,
> Juergen.Zimmermann@HS-Karlsruhe.de wrote:
> > Using plain java.net I can use this sequence to obtain an error message
> > submitted by the HTTP server:
> > HttpURLConnection conn = ...;
> > conn.connect();
> > InputStream inputStream = conn.getErrorStream();
> >
> > How can I get an InputStream representing the error stream when I'm using
> > HttpComponents?
> >
> >
>
> HttpCore does not support the concept of an error stream. One should use
> HttpEntity#getContent to obtain the response data stream regardless of the
> HTTP
> response status.
>
> Hope this helps
>
> Oleg
>
>
>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> > For additional commands, e-mail: httpclient-users-help@hc.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>
Re: How to get error stream ?
Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, Aug 05, 2009 at 03:40:15PM +0200, Juergen.Zimmermann@HS-Karlsruhe.de wrote:
> Using plain java.net I can use this sequence to obtain an error message
> submitted by the HTTP server:
> HttpURLConnection conn = ...;
> conn.connect();
> InputStream inputStream = conn.getErrorStream();
>
> How can I get an InputStream representing the error stream when I'm using
> HttpComponents?
>
>
HttpCore does not support the concept of an error stream. One should use
HttpEntity#getContent to obtain the response data stream regardless of the HTTP
response status.
Hope this helps
Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org