Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 37 for newBuilder (0.22 sec)

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

            val sameHost = address.url.host
            val differentPort = address.url.port + 1
            chain.proceed(
              chain.request().newBuilder()
                .url("http://$sameHost:$differentPort/")
                .build(),
            )
          }
        client =
          client.newBuilder()
            .addNetworkInterceptor(interceptor)
            .build()
        val request =
          Request.Builder()
            .url(server.url("/"))
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Jan 14 10:20:09 GMT 2024
    - 27.8K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/ConnectionCoalescingTest.kt

        val differentDnsUrl = url.newBuilder().host("differentdns.com").build()
        assertFailsWith<IOException> {
          execute(differentDnsUrl)
        }
      }
    
      @Test
      fun skipsOnRedirectWhenDnsDontMatch() {
        server.enqueue(
          MockResponse.Builder()
            .code(301)
            .addHeader("Location", url.newBuilder().host("differentdns.com").build())
            .build(),
        )
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 18.7K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/RouteFailureTest.kt

      private fun enableProtocol(protocol: Protocol) {
        enableTls()
        client =
          client.newBuilder()
            .protocols(listOf(protocol, Protocol.HTTP_1_1))
            .build()
        server1.protocols = client.protocols
        server2.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
    - 11.9K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/internal/cache/CacheInterceptor.kt

            .build().also {
              listener.satisfactionFailure(call, it)
            }
        }
    
        // If we don't need the network, we're done.
        if (networkRequest == null) {
          return cacheResponse!!.newBuilder()
            .cacheResponse(cacheResponse.stripBody())
            .build().also {
              listener.cacheHit(call, it)
            }
        }
    
        if (cacheResponse != null) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Mar 22 07:09:21 GMT 2024
    - 10.2K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/CookiesTest.kt

      fun setUp(server: MockWebServer) {
        this.server = server
      }
    
      @Test
      fun testNetscapeResponse() {
        val cookieManager = CookieManager(null, CookiePolicy.ACCEPT_ORIGINAL_SERVER)
        client =
          client.newBuilder()
            .cookieJar(JavaNetCookieJar(cookieManager))
            .build()
        val urlWithIpAddress = urlWithIpAddress(server, "/path/foo")
        server.enqueue(
          MockResponse.Builder()
            .addHeader(
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13K bytes
    - Viewed (0)
  6. android-test/src/androidTest/java/okhttp/android/test/OkHttpTest.kt

      }
    
      @Test
      fun testDnsOverHttps() {
        assumeNetwork()
    
        client =
          client.newBuilder()
            .eventListenerFactory(clientTestRule.wrap(LoggingEventListener.Factory()))
            .build()
    
        val dohDns = buildCloudflareIp(client)
        val dohEnabledClient =
          client.newBuilder().eventListener(EventListener.NONE).dns(dohDns).build()
    
        dohEnabledClient.get("https://www.twitter.com/robots.txt")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 27K bytes
    - Viewed (1)
  7. okhttp/src/test/java/okhttp3/ConnectionReuseTest.kt

        val request = Request(server.url("/"))
        assertConnectionNotReused(request, request)
      }
    
      @Test
      fun connectionsAreNotReusedIfPoolIsSizeZero() {
        client =
          client.newBuilder()
            .connectionPool(ConnectionPool(0, 5, TimeUnit.SECONDS))
            .build()
        server.enqueue(MockResponse(body = "a"))
        server.enqueue(MockResponse(body = "b"))
        val request = Request(server.url("/"))
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 12.3K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/OkHttpClientTest.kt

          client.newBuilder()
            .dns { listOf() }
            .build()
            .routeDatabase,
        )
        assertNotSame(
          client.routeDatabase,
          client.newBuilder()
            .proxyAuthenticator { _: Route?, _: Response? -> null }
            .build()
            .routeDatabase,
        )
        assertNotSame(
          client.routeDatabase,
          client.newBuilder()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Mar 31 17:16:15 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  9. okhttp-dnsoverhttps/src/test/java/okhttp3/dnsoverhttps/DnsOverHttpsTest.kt

      // 4. successful stale cached GET response
      // 5. unsuccessful response
      @Test
      fun usesCache() {
        val cache = Cache(cacheFs, "cache".toPath(), (100 * 1024).toLong())
        val cachedClient = bootstrapClient.newBuilder().cache(cache).build()
        val cachedDns = buildLocalhost(cachedClient, false)
    
        repeat(2) {
          server.enqueue(
            dnsResponse(
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 11K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/internal/ws/WebSocketHttpTest.kt

          "Request header not permitted: 'Sec-WebSocket-Extensions'",
        )
      }
    
      @Test
      fun webSocketAndApplicationInterceptors() {
        val interceptedCount = AtomicInteger()
        client =
          client.newBuilder()
            .addInterceptor(
              Interceptor { chain: Interceptor.Chain ->
                assertThat(chain.request().body).isNull()
                val response = chain.proceed(chain.request())
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Mar 31 17:16:15 GMT 2024
    - 35.2K bytes
    - Viewed (1)
Back to top