Using Square's Retrofit Client, is it possible to cancel an in progress request? If so how?

前端 未结 7 2056
隐瞒了意图╮
隐瞒了意图╮ 2020-12-25 14:07

I\'m using Square\'s Retrofit Client to make short-lived json requests from an Android App. Is there a way to cancel a request? If so, how?

7条回答
  •  庸人自扰
    2020-12-25 14:51

    Now there is an easy way in latest version of Retrofit V 2.0.0.beta2. Can implement retry too.
    Take a look here How to cancel ongoing request in retrofit when retrofit.client.UrlConnectionClient is used as client?

提交回复
热议问题