Retrieving content length of response |
To retrieve the content length of an HttpResponse invoke the HttpResponse#getContentLength method. The content length is contained in the Content-Length header returned in the HttpResponse. This value represents the total number of bytes returned in the response including the body of the response and any headers. If the Content-Length header is not included in the HttpResponse then the value returned will be –1.
Example
// get content length int length = response.getContentLength(); |