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

Option to Cancel Request #85

Closed
choiruru opened this issue Dec 9, 2019 · 1 comment
Closed

Option to Cancel Request #85

choiruru opened this issue Dec 9, 2019 · 1 comment

Comments

@choiruru
Copy link

choiruru commented Dec 9, 2019

There is search feature in my project.
This feature do call request every I type a letter.
How to cancel previous requests..??

thanks.

@feronetick
Copy link

feronetick commented Dec 26, 2019

You can use dio's cancellation feature (https://github.com/flutterchina/dio#cancellation) with @CancelRequest annotation

@GET("/cities/")
Future getCities([@CancelRequest() CancelToken cancelToken]);

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

No branches or pull requests

2 participants