Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for bodyDelay (0.19 sec)

  1. okhttp/src/test/java/okhttp3/DuplexTest.kt

      @Test
      fun bodyReadTimeoutDoesNotStartUntilLastRequestBodyByteFire() {
        enableProtocol(Protocol.HTTP_2)
        server.enqueue(
          MockResponse.Builder()
            .bodyDelay(1500, TimeUnit.MILLISECONDS)
            .body("this should never be received")
            .build(),
        )
        val request =
          Request.Builder()
            .url(server.url("/"))
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 23.9K bytes
    - Viewed (0)
  2. mockwebserver/src/main/kotlin/mockwebserver3/MockResponse.kt

        }
    
        /**
         * Set the delayed time of the response body to [delay]. This applies to the response body
         * only; response headers are not affected.
         */
        fun bodyDelay(
          delay: Long,
          unit: TimeUnit,
        ) = apply {
          bodyDelayNanos = unit.toNanos(delay)
        }
    
        fun headersDelay(
          delay: Long,
          unit: TimeUnit,
        ) = apply {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Tue Jan 23 14:31:42 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/ConnectionReuseTest.kt

            .connectionPool(ConnectionPool(0, 5, TimeUnit.SECONDS))
            .build()
        server.enqueue(
          MockResponse.Builder()
            .code(301)
            .addHeader("Location: /b")
            .bodyDelay(1, TimeUnit.SECONDS)
            .body("a")
            .build(),
        )
        server.enqueue(MockResponse(body = "b"))
        val request = Request(server.url("/"))
        val response = client.newCall(request).execute()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 12.3K bytes
    - Viewed (0)
  4. mockwebserver/api/mockwebserver3.api

    	public final fun body (Lmockwebserver3/MockResponseBody;)Lmockwebserver3/MockResponse$Builder;
    	public final fun body (Lokio/Buffer;)Lmockwebserver3/MockResponse$Builder;
    	public final fun bodyDelay (JLjava/util/concurrent/TimeUnit;)Lmockwebserver3/MockResponse$Builder;
    	public final fun build ()Lmockwebserver3/MockResponse;
    	public final fun chunkedBody (Ljava/lang/String;I)Lmockwebserver3/MockResponse$Builder;
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Tue Jan 03 21:59:45 UTC 2023
    - 12.7K bytes
    - Viewed (0)
  5. mockwebserver/src/test/java/mockwebserver3/MockWebServerTest.kt

      }
    
      /** Delay the response body by sleeping 1s.  */
      @Test
      fun delayResponse() {
        assumeNotWindows()
        server.enqueue(
          MockResponse.Builder()
            .body("ABCDEF")
            .bodyDelay(1, TimeUnit.SECONDS)
            .build(),
        )
        val startNanos = System.nanoTime()
        val connection = server.url("/").toUrl().openConnection()
        val inputStream = connection!!.getInputStream()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 23.5K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/internal/ws/WebSocketHttpTest.kt

      @Test
      @Throws(InterruptedException::class)
      fun reconnectingToNonWebSocket() {
        for (i in 0..29) {
          webServer.enqueue(
            MockResponse.Builder()
              .bodyDelay(100, TimeUnit.MILLISECONDS)
              .body("Wrong endpoint")
              .code(401)
              .build(),
          )
        }
        val request =
          Request.Builder()
            .url(webServer.url("/"))
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Mar 31 17:16:15 UTC 2024
    - 35.2K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/KotlinSourceModernTest.kt

        throttleBytesPerPeriod = mockResponse.throttleBytesPerPeriod
        var throttlePeriod: Long = mockResponse.getThrottlePeriod(TimeUnit.SECONDS)
        mockResponse = mockResponse.setBodyDelay(0L, TimeUnit.SECONDS)
        val bodyDelay: Long = mockResponse.getBodyDelay(TimeUnit.SECONDS)
        mockResponse = mockResponse.setHeadersDelay(0L, TimeUnit.SECONDS)
        val headersDelay: Long = mockResponse.getHeadersDelay(TimeUnit.SECONDS)
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Apr 01 14:21:25 UTC 2024
    - 46.5K bytes
    - Viewed (0)
Back to top