Track the progress of an HTTP request. This can be useful if you are
requesting a large amount of data and want to show the user a progress bar
or something.
Here is an example usage: demo and code.
Note: If you stop tracking progress, you cancel the request.
Progress
The progress of an HTTP request.
You start with
None. As data starts to come in, you will seeSome. ThebytesExpectedfield will match theContent-Lengthheader, indicating how long the response body is in bytes (8-bits). Thebytesfield indicates how many bytes have been loaded so far, so if you want progress as a percentage, you would say:You will end up with
FailorDonedepending on the success of the request.