Authenticator当我收到身份验证质询 (401) 时,我扩展以检索授权和身份验证令牌。它会重试 20 次。有没有办法设置不同的计数(我想将其设置为 3)?
为了以防万一,我将 OkHttp(3) 与 Retrofit2 结合使用。
请参阅处理身份验证文档:
private int responseCount(Response response) {
int result = 1;
while ((response = response.priorResponse()) != null) {
result++;
}
return result;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2324 次 |
| 最近记录: |