Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 81 for newBuilder (0.49 sec)

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

       */
      private fun enableProtocol(protocol: Protocol) {
        enableTls()
        client =
          client.newBuilder()
            .protocols(listOf(protocol, Protocol.HTTP_1_1))
            .build()
        server.protocols = client.protocols
      }
    
      private fun enableTls() {
        client =
          client.newBuilder()
            .sslSocketFactory(
              handshakeCertificates.sslSocketFactory(),
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 23.9K bytes
    - Viewed (0)
  2. okhttp-dnsoverhttps/src/main/kotlin/okhttp3/dnsoverhttps/DnsOverHttps.kt

          if (post) {
            url(url)
              .cacheUrlOverride(
                url.newBuilder()
                  .addQueryParameter("hostname", hostname).build(),
              )
              .post(query.toRequestBody(DNS_MESSAGE))
          } else {
            val encoded = query.base64Url().replace("=", "")
            val requestUrl = url.newBuilder().addQueryParameter("dns", encoded).build()
    
            url(requestUrl)
          }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Mar 22 07:09:21 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  3. samples/guide/src/main/java/okhttp3/recipes/kt/PerCallSettings.kt

          Request.Builder()
            .url("http://httpbin.org/delay/1") // This URL is served with a 1 second delay.
            .build()
    
        // Copy to customize OkHttp for this request.
        val client1 =
          client.newBuilder()
            .readTimeout(500, TimeUnit.MILLISECONDS)
            .build()
        try {
          client1.newCall(request).execute().use { response ->
            println("Response 1 succeeded: $response")
          }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.7K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/Authenticator.kt

     * for (Challenge challenge : response.challenges()) {
     *   // If this is preemptive auth, use a preemptive credential.
     *   if (challenge.scheme().equalsIgnoreCase("OkHttp-Preemptive")) {
     *     return response.request().newBuilder()
     *         .header("Proxy-Authorization", "secret")
     *         .build();
     *   }
     * }
     * return null; // Didn't find a preemptive auth scheme.
     * ```
     *
     * ## Reactive Authentication
     *
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.5K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/FastFallbackTest.kt

            .connectTimeout(60, TimeUnit.SECONDS) // Deliberately exacerbate slow fallbacks.
            .dns { dnsResults }
            .fastFallback(true)
            .build()
        url =
          serverIpv4.url("/")
            .newBuilder()
            .host("localhost")
            .build()
      }
    
      @AfterEach
      internal fun tearDown() {
        serverIpv4.shutdown()
        serverIpv6.shutdown()
      }
    
      @Test
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.3K bytes
    - Viewed (0)
  6. samples/compare/src/test/kotlin/okhttp3/compare/JavaHttpClientTest.kt

        platform.expectFailureOnJdkVersion(8)
    
        val httpClient =
          HttpClient.newBuilder()
            .followRedirects(NORMAL)
            .build()
    
        server.enqueue(
          MockResponse.Builder()
            .body("hello, Java HTTP Client")
            .build(),
        )
    
        val request =
          HttpRequest.newBuilder(server.url("/").toUri())
            .header("Accept", "text/plain")
            .build()
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  7. android-test/src/androidTest/java/okhttp/android/test/sni/SniOverrideTest.kt

              sslSocket.sslParameters = parameters
            }
    
            return sslSocket
          }
        }
    
        client =
          client.newBuilder()
            .sslSocketFactory(CustomSSLSocketFactory(client.sslSocketFactory), client.x509TrustManager!!)
            .hostnameVerifier { hostname, session ->
              val s = "hostname: $hostname peerHost:${session.peerHost}"
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.6K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/ServerTruncatesRequestTest.kt

      }
    
      private fun enableProtocol(protocol: Protocol) {
        enableTls()
        client =
          client.newBuilder()
            .protocols(listOf(protocol, Protocol.HTTP_1_1))
            .build()
        server.protocols = client.protocols
      }
    
      private fun enableTls() {
        client =
          client.newBuilder()
            .sslSocketFactory(
              handshakeCertificates.sslSocketFactory(),
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.5K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/Request.kt

       * [newBuilder].
       *
       * @suppress this method breaks Dokka! https://github.com/Kotlin/dokka/issues/2473
       */
      fun tag(): Any? = tag<Any>()
    
      /**
       * Returns the tag attached with [type] as a key, or null if no tag is attached with that
       * key.
       */
      fun <T> tag(type: Class<out T>): T? = tag(type.kotlin)
    
      fun newBuilder(): Builder = Builder(this)
    
      /**
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 04:17:44 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  10. mockwebserver/src/test/java/mockwebserver3/MockResponseSniTest.kt

              handshakeCertificates.sslSocketFactory(),
              handshakeCertificates.trustManager,
            )
            .dns(dns)
            .build()
    
        server.enqueue(MockResponse())
    
        val url = server.url("/").newBuilder().host("localhost.localdomain").build()
        val call = client.newCall(Request(url = url))
        val response = call.execute()
        assertThat(response.isSuccessful).isTrue()
    
        val recordedRequest = server.takeRequest()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.9K bytes
    - Viewed (1)
Back to top