- Sort Score
- Num 10 results
- Language All
Results 1 - 2 of 2 for responseCount (0.15 seconds)
-
okhttp/src/commonJvmAndroid/kotlin/okhttp3/Authenticator.kt
* to limit the retries by the class of errors and number of attempts. To get the number of * attempts to the current point use this function. * * ```java * private int responseCount(Response response) { * int result = 1; * while ((response = response.priorResponse()) != null) { * result++; * } * return result; * } * ``` *Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Fri Dec 27 13:39:56 GMT 2024 - 5.5K bytes - Click Count (0) -
docs/recipes.md
```kotlin if (response.responseCount >= 3) { return null // If we've failed 3 times, give up. } ``` This above code relies on this `responseCount` extension val: ```kotlin val Response.responseCount: Int get() = generateSequence(this) { it.priorResponse }.count() ```Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Sun Mar 15 09:01:42 GMT 2026 - 47.8K bytes - Click Count (0)