Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for chunkedBody (0.13 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. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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