How to retry HTTP requests with OkHttp/Retrofit?

后端 未结 13 729
一向
一向 2020-12-07 09:04

I am using Retrofit/OkHttp (1.6) in my Android project.

I don\'t find any request retry mechanism built-in to either of them. On searching more, I read OkHttp seems

13条回答
  •  春和景丽
    2020-12-07 09:59

    It seems it will be present in retrofit 2.0 from the API Spec: https://github.com/square/retrofit/issues/297. Currently, the best way seems to be catch exception and retry manually.

提交回复
热议问题