hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Multipart-mime PostMethod content streaming
Date Mon, 16 Jan 2006 20:46:02 GMT
Roland Weber wrote:
> Hello David,
> 
> 
>>Basically I'm looking to get the Request Output Stream from the HTTP 
>>Client after setting time-out parameters, to write file data to the stream 
>>at the same time that it's being read from disk and to avoid loading the 
>>files' bytes into memory ahead of time as when using the PostMethod.
>>
>>Does anyone know if/how I can do this?
> 
> 
> You can't. What you can do is the reverse: you provide an InputStream
> from which the HttpClient will read the bytes which will be sent to the
> server. See class InputStreamRequestEntity:
> http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/methods/InputStreamRequestEntity.html
> 
> HttpClient will take care of chunk encoding.
> 
> hope that helps,
>   Roland
> 

David,

Just implement a custom RequestEntity. When submitting an entity 
enclosing request HttpClient passes an OutputStream instance onto the 
RequestEntity implementation, which the latter can use to stream out its 
content.

Hope this helps

Oleg


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


Mime
View raw message