Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 578 for headersOf (0.09 sec)

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

    import mockwebserver3.MockResponse
    import mockwebserver3.MockWebServer
    import mockwebserver3.SocketPolicy.DisconnectAfterRequest
    import mockwebserver3.SocketPolicy.DisconnectAtEnd
    import okhttp3.Headers.Companion.headersOf
    import okhttp3.MediaType.Companion.toMediaType
    import okhttp3.RequestBody.Companion.toRequestBody
    import okhttp3.ResponseBody.Companion.toResponseBody
    import okhttp3.internal.closeQuietly
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 12.3K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/ServerTruncatesRequestTest.kt

    import javax.net.ssl.SSLSocket
    import kotlin.test.assertFailsWith
    import mockwebserver3.MockResponse
    import mockwebserver3.MockWebServer
    import mockwebserver3.SocketPolicy.DoNotReadRequestBody
    import okhttp3.Headers.Companion.headersOf
    import okhttp3.internal.duplex.AsyncRequestBody
    import okhttp3.internal.http2.ErrorCode
    import okhttp3.testing.PlatformRule
    import okio.BufferedSink
    import okio.IOException
    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/src/test/java/okhttp3/internal/ws/RealWebSocketTest.kt

        client.listener.assertTextMessage(message)
      }
    
      @Test
      fun messagesCompressedWhenConfigured() {
        val headers = headersOf("Sec-WebSocket-Extensions", "permessage-deflate")
        client.initWebSocket(random, responseHeaders = headers)
        server.initWebSocket(random, responseHeaders = headers)
        val message = repeat('a', RealWebSocket.DEFAULT_MINIMUM_DEFLATE_SIZE.toInt())
        server.webSocket!!.send(message)
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Thu Apr 11 01:59:58 UTC 2024
    - 18.5K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/internal/http2/HttpOverHttp2Test.kt

        client =
          client.newBuilder()
            .cache(cache)
            .build()
        server.enqueue(
          MockResponse(
            headers = headersOf("cache-control", "max-age=60"),
            body = "ABCD",
          ),
        )
        server.enqueue(
          MockResponse(
            headers = headersOf("cache-control", "max-age=60"),
            body = "EFGH",
          ),
        )
        val call1 = client.newCall(Request(server.url("/")))
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Thu Apr 11 22:09:35 UTC 2024
    - 75.3K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/DuplexTest.kt

            .addHeader("h2", "v2")
            .trailers(headersOf("trailers", "boom"))
            .streamHandler(body)
            .build(),
        )
        val call =
          client.newCall(
            Request.Builder()
              .url(server.url("/"))
              .build(),
          )
        call.execute().use { response ->
          assertThat(response.headers)
            .isEqualTo(headersOf("h1", "v1", "h2", "v2"))
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 23.9K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/ConnectionListenerTest.kt

    import java.util.concurrent.TimeUnit
    import kotlin.test.assertFailsWith
    import mockwebserver3.MockResponse
    import mockwebserver3.MockWebServer
    import mockwebserver3.SocketPolicy.FailHandshake
    import okhttp3.Headers.Companion.headersOf
    import okhttp3.internal.DoubleInetAddressDns
    import okhttp3.internal.connection.RealConnectionPool.Companion.get
    import okhttp3.testing.Flaky
    import okhttp3.testing.PlatformRule
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 9.6K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/ResponseJvmTest.kt

          response.trailers()
        }
      }
    
      @Test
      fun worksIfTrailersSet() {
        val response =
          newResponse("".toResponseBody()) {
            trailers {
              Headers.headersOf("a", "b")
            }
          }
    
        assertThat(response.trailers()["a"]).isEqualTo("b")
      }
    
      @Test fun peekAfterReadingResponse() {
        val response = newResponse(responseBody("abc"))
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/Request.kt

        /** Removes all headers named [name] on this builder. */
        open fun removeHeader(name: String) = commonRemoveHeader(name)
    
        /** Removes all headers on this builder and adds [headers]. */
        open fun headers(headers: Headers) = commonHeaders(headers)
    
        /**
         * Sets this request's `Cache-Control` header, replacing any cache control headers already
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Apr 06 04:17:44 UTC 2024
    - 10.5K bytes
    - Viewed (0)
  9. mockwebserver/src/main/kotlin/mockwebserver3/MockResponse.kt

        ): Builder = chunkedBody(Buffer().writeUtf8(body), maxChunkSize)
    
        /** Sets the headers and returns this. */
        fun headers(headers: Headers) =
          apply {
            this.headers = headers.newBuilder()
          }
    
        /** Sets the trailers and returns this. */
        fun trailers(trailers: Headers) =
          apply {
            this.trailers = trailers.newBuilder()
          }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Tue Jan 23 14:31:42 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  10. docs/changelogs/upgrading_to_okhttp_4.md

     * **TlsVersion**: javaName
    
    #### Renamed Functions
    
    * **Headers.of()**: for symmetry with `listOf()`, `setOf()`, etc., we’ve replaced
      `Headers.of(String...)` with `headersOf(vararg String)`.
    
    #### Extension Functions
    
    We’ve migrated from static functions to extension functions where we think they fit.
    
    | Java                                | Kotlin                          |
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Feb 06 16:58:16 UTC 2022
    - 10.9K bytes
    - Viewed (0)
Back to top