hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zhaohua Meng" <zhaohua.m...@gmail.com>
Subject Re: how to use PostMethod to stream request?
Date Thu, 18 Sep 2008 17:49:39 GMT
I was able to use java.net classes to make my code work. Apparently,
Sun's URLConnection has internal buffer to handle the request
streaming without content length pre-calculated. It sets the
Content-Length header correctly in my test with small data. Later I
will find out if it can deal with large data. Ideally it should switch
to chunked transfer encoding automatically.

Thanks,

On Thu, Sep 18, 2008 at 11:16 AM, Yan aka. Yansheng
<yansheng.lin@gmail.com> wrote:
> The example you provided use the File as the buffer and then send as it over
> the network a RequestEntity.  There is not direct IO writes to an http
> connection in HttpClient.
>
> On Wed, Sep 17, 2008 at 10:52 AM, Oleg Kalnichevski <olegk@apache.org>wrote:
>
>> On Wed, 2008-09-17 at 08:27 -0700, Yan aka. Yansheng wrote:
>> > I had a similar problem.  From what I gathered, HttpClient does not
>> support
>> > stream IO directly.  It's not meant for streaming IO.
>>
>> This is most certainly is _NOT_ the case. HttpClient is fully capable of
>> streaming data in and out since version 2.0.
>>
>> Oleg
>>
>> >   So one solution is to
>> > buffer your output locally and send in batch at the end.
>> >
>> > Hope this helps.
>> >
>> > Yansheng Lin
>> >
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>>
>>
>



-- 
Zhaohua Meng
zhaohua.meng@gmail.com

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


Mime
View raw message