RetryInterceptor

class RetryInterceptor(@IntRange(from = 1.toLong()retryCount: Int) : Interceptor

重试次数拦截器 OkHttp自带重试请求规则, 本拦截器并不推荐使用 因为长时间阻塞用户请求是不合理的, 发生错误请让用户主动重试, 例如显示缺省页或者提示

Constructors

RetryInterceptor
Link copied to clipboard
fun RetryInterceptor(@IntRange(from = 1.toLong()retryCount: Int = 3)

Functions

intercept
Link copied to clipboard
open override fun intercept(chain: Interceptor.Chain): Response

Properties

retryCount
Link copied to clipboard
var retryCount: Int = 3
重试次数