You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Hiranya Jayathilaka <hi...@gmail.com> on 2009/09/09 08:30:25 UTC
Calculating Message Size
Hi Devs,
Is there a way to get the message size (in bytes) from a HttpRequest object?
What is the right way to go about doing this?
Thanks
--
Hiranya Jayathilaka
Software Engineer;
WSO2 Inc.; http://wso2.org
E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com
Re: Calculating Message Size
Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, Sep 09, 2009 at 12:00:25PM +0530, Hiranya Jayathilaka wrote:
> Hi Devs,
>
> Is there a way to get the message size (in bytes) from a HttpRequest object?
> What is the right way to go about doing this?
>
> Thanks
>
Hiranya,
HttpEntity#getContentLength() is what you want. If this method returns a
negative value, the content length is unknown / generated dynamically using
the chunk or identity coding.
Hope this helps
Oleg
--
> Hiranya Jayathilaka
> Software Engineer;
> WSO2 Inc.; http://wso2.org
> E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> Blog: http://techfeast-hiranya.blogspot.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org