It really depends on your usecase.
getResponseBodyAsString will buffer the entire response into a String,
which could cause unnecessary memory usage. If you are going to turn
around and stream the response somewhere, i.e. disc or servlet response.
Also, keep in mind that getResponseBodyAsString will have to deal with
character encoding. My experience with 3.1 is that it doesn't work too
well. I had to override it with the mozilla library for charset
detection.
Hope this helps.
Douglas
On Oct 8, 2009, at 12:25 PM, Randy Paries wrote:
> I was wondering if someone could give me insight on when to use
> getResponseBodyAsStream vs. getResponseBodyAsString
>
> The getResponseBodyAsString seems to be very straight forward but
> would like to understand the best scenarios for each
>
> thanks
> Randy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
httpclient-users-unsubscribe@...
> For additional commands, e-mail:
httpclient-users-help@...
>
---------------------------------------------------------------------
To unsubscribe, e-mail:
httpclient-users-unsubscribe@...
For additional commands, e-mail:
httpclient-users-help@...