Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can we get the progress of the request? #12

Open
mathew-kurian opened this issue Oct 14, 2015 · 3 comments
Open

How can we get the progress of the request? #12

mathew-kurian opened this issue Oct 14, 2015 · 3 comments

Comments

@mathew-kurian
Copy link

No description provided.

@hgoebl
Copy link
Owner

hgoebl commented Oct 14, 2015

Currently there is no easy way of getting the progress. It's one of the features I'm thinking about to implement, but not in next future.

In the meantime, if it's really important for you, you could do following:

Create an intercepting InputStream which counts the number of read-calls (or bytes read). Wrap your real InputStream with this intercepting stream and give this to DavidWebb as body of the request. Your interception can now track the progress.

What do you use as body? byte[], File, InputStream, String, ...?

@mathew-kurian
Copy link
Author

I see. Thank you. I am using an InputStream for the body.

@hgoebl
Copy link
Owner

hgoebl commented Oct 14, 2015

Do you know the length in advance? Then you could have a look at ProxyInputStream (as an example) and let this stream call you back when bytes are read.

Obviously without the length you can just report the number of bytes transferred, but not the percentage.

I'll leave this issue open as an enhancement request, because this is one of the features requested most often.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants