Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for onlyResponse (0.06 sec)

  1. okhttp-testing-support/src/main/kotlin/okhttp3/internal/RecordingOkAuthenticator.kt

    import okhttp3.Route
    
    class RecordingOkAuthenticator(
      val credential: String?,
      val scheme: String?,
    ) : Authenticator {
      val responses = mutableListOf<Response>()
      val routes = mutableListOf<Route>()
    
      fun onlyResponse() = responses.single()
    
      fun onlyRoute() = routes.single()
    
      @Throws(IOException::class)
      override fun authenticate(
        route: Route?,
        response: Response,
      ): Request? {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 1.7K bytes
    - Viewed (0)
  2. okhttp/src/jvmTest/kotlin/okhttp3/URLConnectionTest.kt

        assertThat(server.takeRequest().headers["Authorization"]).isEqualTo(credential)
        assertThat(authenticator.onlyRoute().proxy).isEqualTo(Proxy.NO_PROXY)
        val response = authenticator.onlyResponse()
        assertThat(
          response.request.url
            .toUrl()
            .path,
        ).isEqualTo("/private")
        assertThat(response.challenges()).isEqualTo(listOf(Challenge("Basic", "protected area")))
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Jun 21 20:36:35 UTC 2025
    - 133.2K bytes
    - Viewed (0)
Back to top