Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for throttleBody (0.05 sec)

  1. okhttp/src/jvmTest/kotlin/okhttp3/URLConnectionTest.kt

        assertThat(getResponse(Request(url)).code).isEqualTo(407)
      }
    
      @Test
      fun disconnectedConnection() {
        server.enqueue(
          MockResponse
            .Builder()
            .throttleBody(2, 100, TimeUnit.MILLISECONDS)
            .body("ABCD")
            .build(),
        )
        val call = client.newCall(newRequest("/"))
        val response = call.execute()
        val inputStream = response.body.byteStream()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Jun 21 20:36:35 UTC 2025
    - 133.2K bytes
    - Viewed (0)
  2. okhttp/src/jvmTest/kotlin/okhttp3/CallTest.kt

      }
    
      @Test
      fun timeoutsUpdatedOnReusedConnections() {
        server.enqueue(MockResponse(body = "abc"))
        server.enqueue(
          MockResponse
            .Builder()
            .body("def")
            .throttleBody(1, 750, TimeUnit.MILLISECONDS)
            .build(),
        )
    
        // First request: time out after 1s.
        client =
          client
            .newBuilder()
            .readTimeout(Duration.ofSeconds(1))
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu Jul 31 04:18:40 UTC 2025
    - 146.6K bytes
    - Viewed (0)
  3. okhttp/src/jvmTest/kotlin/okhttp3/CacheTest.kt

        // Setting a low transfer speed ensures that stream discarding will time out.
        val builder =
          MockResponse
            .Builder()
            .throttleBody(6, 1, TimeUnit.SECONDS)
        transferKind.setBody(builder, "ABCDE\nFGHIJKLMNOPQRSTUVWXYZ", 1024)
        server.enqueue(builder.build())
        server.enqueue(
          MockResponse
            .Builder()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 16 09:39:51 UTC 2025
    - 113.6K bytes
    - Viewed (0)
Back to top