user496949
user496949

Reputation: 86135

When using Apache Httpclient , is there a way to get downloading status?

Anyway to get he downloading status like how much it has finished?

Upvotes: 0

Views: 173

Answers (1)

Maurice Perry
Maurice Perry

Reputation: 32831

It depends™: the server can (or not) send a Content-Length header before it sends the content itseft. In this case, yes, it's possible: get the header value, then get the response output steam and read from it by chunks of fixed size, and update the status at each iteration. If the header is not present, no, you have no clue about the remaining content to read.

Upvotes: 1

Related Questions