Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 31 - 40 of 49 for HTTP_2 (0.04 seconds)

  1. regression-test/src/androidTest/java/okhttp/regression/LetsEncryptTest.java

                .url(url)
                .build();
        try (Response response = client.newCall(request).execute()) {
          assertTrue(response.code() == 200 || response.code() == 404);
          assertEquals(Protocol.HTTP_2, response.protocol());
        }
      }
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Tue Nov 17 07:40:31 GMT 2020
    - 6.1K bytes
    - Click Count (0)
  2. okhttp-zstd/src/test/java/okhttp3/zstd/ZstdInterceptorTest.kt

        Response
          .Builder()
          .body(body.toResponseBody("text/plain".toMediaType()))
          .code(200)
          .message("OK")
          .request(Request.Builder().url(url).build())
          .protocol(Protocol.HTTP_2)
          .apply(fn)
          .build()
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Fri Aug 01 06:04:22 GMT 2025
    - 4.8K bytes
    - Click Count (1)
  3. container-tests/src/test/java/okhttp3/containers/BasicProxyTest.kt

              ).execute()
    
          assertThat(response.body.string()).contains("Peter the person")
          assertThat(response.protocol).isEqualTo(Protocol.HTTP_2)
        }
      }
    
      @Test
      fun testOkHttpSecureProxiedHttp1() {
        testRequest {
          val client =
            OkHttpClient
              .Builder()
              .trustMockServer()
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed Mar 19 19:25:20 GMT 2025
    - 6.2K bytes
    - Click Count (1)
  4. mockwebserver/src/main/kotlin/mockwebserver3/MockResponse.kt

        /**
         * When [protocols][MockWebServer.protocols] include [HTTP_2][okhttp3.Protocol], this attaches a
         * pushed stream to this response.
         */
        public fun addPush(promise: PushPromise): Builder =
          apply {
            this.pushPromises_ += promise
          }
    
        /**
         * When [protocols][MockWebServer.protocols] include [HTTP_2][okhttp3.Protocol], this pushes
         * [settings] before writing the response.
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Fri Jun 20 11:46:46 GMT 2025
    - 17.8K bytes
    - Click Count (0)
  5. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/http2/Http2ExchangeCodec.kt

      @Volatile private var stream: Http2Stream? = null
    
      private val protocol: Protocol =
        if (Protocol.H2_PRIOR_KNOWLEDGE in client.protocols) {
          Protocol.H2_PRIOR_KNOWLEDGE
        } else {
          Protocol.HTTP_2
        }
    
      @Volatile
      private var canceled = false
    
      override val isResponseComplete: Boolean
        get() = stream?.isSourceComplete == true
    
      override val socket: Socket
        get() = stream!!
    
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Tue Jul 29 21:11:09 GMT 2025
    - 7K bytes
    - Click Count (0)
  6. okhttp-dnsoverhttps/src/test/java/okhttp3/dnsoverhttps/DnsOverHttpsTest.kt

      private lateinit var dns: Dns
      private val cacheFs = FakeFileSystem()
      private val eventRecorder = EventRecorder()
      private val bootstrapClient =
        OkHttpClient
          .Builder()
          .protocols(listOf(Protocol.HTTP_2, Protocol.HTTP_1_1))
          .eventListener(eventRecorder.eventListener)
          .build()
    
      @BeforeEach
      fun setUp() {
        server.protocols = bootstrapClient.protocols
        dns = buildLocalhost(bootstrapClient, false)
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Tue Nov 04 19:13:52 GMT 2025
    - 11.9K bytes
    - Click Count (0)
  7. okhttp-dnsoverhttps/src/main/kotlin/okhttp3/dnsoverhttps/DnsOverHttps.kt

      }
    
      @Throws(Exception::class)
      private fun readResponse(
        hostname: String,
        response: Response,
      ): List<InetAddress> {
        if (response.cacheResponse == null && response.protocol !== Protocol.HTTP_2 && response.protocol !== Protocol.QUIC) {
          Platform.get().log("Incorrect protocol: ${response.protocol}", Platform.WARN)
        }
    
        response.use {
          if (!response.isSuccessful) {
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Sat May 10 11:15:14 GMT 2025
    - 8.6K bytes
    - Click Count (0)
  8. okhttp/src/jvmTest/kotlin/okhttp3/internal/http/HttpUpgradesTest.kt

          ResponseBodyStart::class,
          ResponseBodyEnd::class,
          ConnectionReleased::class,
          CallEnd::class,
        )
      }
    
      @Test
      fun upgradeForbiddenOnHttp2() {
        enableTls(Protocol.HTTP_2, Protocol.HTTP_1_1)
        val socketHandler = MockSocketHandler()
        server.enqueue(socketHandler.upgradeResponse())
        val requestWithUpgrade =
          Request
            .Builder()
            .url(server.url("/"))
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Tue Nov 04 19:13:52 GMT 2025
    - 9.6K bytes
    - Click Count (0)
  9. mockwebserver/src/main/kotlin/mockwebserver3/MockWebServer.kt

       *
       * This list is ignored when [negotiation is disabled][protocolNegotiationEnabled].
       */
      public var protocols: List<Protocol> = immutableListOf(Protocol.HTTP_2, Protocol.HTTP_1_1)
        set(value) {
          val protocolList = value.toImmutableList()
          require(Protocol.H2_PRIOR_KNOWLEDGE !in protocolList || protocolList.size == 1) {
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Sat Aug 02 20:36:00 GMT 2025
    - 40.3K bytes
    - Click Count (0)
  10. okhttp/src/jvmTest/kotlin/okhttp3/ConnectionReuseTest.kt

        }
      }
    
      private fun enableHttps() {
        enableHttpsAndAlpn(Protocol.HTTP_1_1)
      }
    
      private fun enableHttp2() {
        platform.assumeHttp2Support()
        enableHttpsAndAlpn(Protocol.HTTP_2, Protocol.HTTP_1_1)
      }
    
      private fun enableHttpsAndAlpn(vararg protocols: Protocol) {
        client =
          client
            .newBuilder()
            .sslSocketFactory(
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Fri Jun 20 11:46:46 GMT 2025
    - 12.2K bytes
    - Click Count (1)
Back to Top