Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for chunkedBody (0.12 sec)

  1. mockwebserver/src/main/kotlin/mockwebserver3/MockResponse.kt

        }
    
        /**
         * Sets the response body to the UTF-8 encoded bytes of [body],
         * chunked every [maxChunkSize] bytes.
         */
        fun chunkedBody(
          body: String,
          maxChunkSize: Int,
        ): Builder = chunkedBody(Buffer().writeUtf8(body), maxChunkSize)
    
        /** Sets the headers and returns this. */
        fun headers(headers: Headers) =
          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)
  2. mockwebserver/api/mockwebserver3.api

    	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;
    	public final fun chunkedBody (Lokio/Buffer;I)Lmockwebserver3/MockResponse$Builder;
    	public final fun clearHeaders ()Lmockwebserver3/MockResponse$Builder;
    	public synthetic fun clone ()Ljava/lang/Object;
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Tue Jan 03 21:59:45 UTC 2023
    - 12.7K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/ServerTruncatesRequestTest.kt

            .trailers(headersOf("caboose", "xyz"))
    
        // Trailers always work for HTTP/2, but only for chunked bodies in HTTP/1.
        if (http2) {
          mockResponse.body("abc")
        } else {
          mockResponse.chunkedBody("abc", 1)
        }
    
        server.enqueue(mockResponse.build())
    
        val call =
          client.newCall(
            Request(
              url = server.url("/"),
              body = SlowRequestBody,
            ),
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 9.5K bytes
    - Viewed (0)
  4. okhttp-logging-interceptor/src/test/java/okhttp3/logging/HttpLoggingInterceptorTest.kt

          .assertNoMoreLogs()
      }
    
      @Test
      fun basicChunkedResponseBody() {
        setLevel(Level.BASIC)
        server.enqueue(
          MockResponse.Builder()
            .chunkedBody("Hello!", 2)
            .setHeader("Content-Type", PLAIN)
            .build(),
        )
        val response = client.newCall(request().build()).execute()
        response.body.close()
        applicationLogs
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Apr 06 09:14:38 UTC 2024
    - 37.6K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

      fun responseHeaders() {
        server.enqueue(
          MockResponse.Builder()
            .status("HTTP/1.0 200 Fantastic")
            .addHeader("A: c")
            .addHeader("B: d")
            .addHeader("A: e")
            .chunkedBody("ABCDE\nFGHIJ\nKLMNO\nPQR", 8)
            .build(),
        )
        val request = newRequest("/")
        val response = getResponse(request)
        assertThat(response.code).isEqualTo(200)
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 131.7K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/EventListenerTest.kt

        enableTlsWithTunnel()
        server.protocols = Arrays.asList(Protocol.HTTP_1_1)
        server.enqueue(
          MockResponse.Builder()
            .bodyDelay(100, TimeUnit.MILLISECONDS)
            .chunkedBody("Hello!", 2)
            .build(),
        )
        assertSuccessfulEventOrder(anyResponse)
        assertBytesReadWritten(
          listener,
          CoreMatchers.any(Long::class.java),
          null,
          greaterThan(0L),
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 56.9K bytes
    - Viewed (2)
  7. okhttp/src/test/java/okhttp3/CacheTest.kt

      internal enum class TransferKind {
        CHUNKED {
          override fun setBody(
            response: MockResponse.Builder,
            content: Buffer,
            chunkSize: Int,
          ) {
            response.chunkedBody(content, chunkSize)
          }
        },
        FIXED_LENGTH {
          override fun setBody(
            response: MockResponse.Builder,
            content: Buffer,
            chunkSize: Int,
          ) {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Wed Apr 10 19:46:48 UTC 2024
    - 108.6K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/CallTest.kt

        server.enqueue(
          MockResponse.Builder()
            .clearHeaders()
            .addHeader("h1", "v1")
            .addHeader("h2", "v2")
            .chunkedBody("HelloBonjour", 1024)
            .trailers(headersOf("trailers", "boom"))
            .build(),
        )
        val call = client.newCall(Request(server.url("/")))
        val response = call.execute()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Wed Apr 10 19:46:48 UTC 2024
    - 142.5K bytes
    - Viewed (0)
Back to top