hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From LongkerDandy <longkerda...@gmail.com>
Subject Re: Content-Length with streaming content
Date Fri, 29 Apr 2011 04:04:05 GMT
Thanks :D

On Fri, Apr 29, 2011 at 11:29 AM, Asankha C. Perera <asankha@apache.org>wrote:

> On 04/29/2011 06:38 AM, LongkerDandy wrote:
>
>> Hi
>>
>> I have a http server send streaming content to clients.
>> I don't know the size of the content because it keep increasing,  like a
>> file being written by another thread or streaming content from web.
>> The server supposes to keep sending until the file in finished or web
>> content reach ends.
>>
>> I wrote a customer HttpEnity, but I don't know how should I return
>> Content-Length header.
>> Should I return a fake number or omit this header?
>>
> You should return -1 (See
> http://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/org/apache/http/HttpEntity.html#getContentLength()
> )
>
> Also refer to
> http://hc.apache.org/httpcomponents-core-ga/tutorial/html/fundamentals.html#d4e84for
details on streaming entities
>
> Hope this helps
> asankha
>
> --
> Asankha C. Perera
> AdroitLogic, http://adroitlogic.org
>
> http://esbmagic.blogspot.com
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message