I would like to know how much data was sent in response to a specific http request. What I'm doing right now is:
HttpURLConnection con = (HttpURLConnection) feedurl.openConnection();
// check the response for the size of the content int feedsize = con.getContentLength ();
The problem is that content-legnth is not always set. For example. when the server uses transfer-encoding = chunked, I return a value of -1.
I need not to display progress information. I just need to know the size of the data that was sent to me after it was done.
Reference Information. I need this information because I would like to compare it with the size of the response that was sent using gzip encoding.
source
share