hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ripok <rkopi...@gmail.com>
Subject Whole HTTP response as InputStream?
Date Fri, 29 Feb 2008 14:36:34 GMT

I have a little problemo: I'm making HTTP request to a server that gives me
back a kind of mime message in the response, so the content-type of the HTTP
response will be "Content-Type: multipart/related;boundary='xxxx'". 

When I'm parsing that mime message (I use mime4j), the parser needs that
content type declaration because there is the boundary definition and it is
part of the message. However if I just get the response body from
HttpMethod, that content-type declaration is not within it because it's in
the HTTP response headers.
One way I can handle this is to get the response body as string (or byte
array) and add that content-type response header to the first line of the
body before giving it to mime parser. However I don't like this because I
want to handle the response as an InputStream to prevent storing the whole
response in memory before handling (the response can be quite big).

So is there a way to get the whole HTTP response as an InputStream, so that
there are the response headers with it. Or can I somehow insert that content
type header to to beginning of response body InputStream?
I'm using HttpClient version 3.1.

View this message in context: http://www.nabble.com/Whole-HTTP-response-as-InputStream--tp15759846p15759846.html
Sent from the HttpClient-User mailing list archive at Nabble.com.

To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org

View raw message