Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 29 for uri (0.17 sec)

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

      }
    
      @Test
      fun fromUri() {
        val uri = URI("http://username:password@host/path?query#fragment")
        val httpUrl = uri.toHttpUrlOrNull()
        assertThat(httpUrl.toString())
          .isEqualTo("http://username:password@host/path?query#fragment")
      }
    
      @Test
      fun fromUriUnsupportedScheme() {
        val uri = URI("mailto:******@****.***")
        assertThat(uri.toHttpUrlOrNull()).isNull()
      }
    
      @Test
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.9K bytes
    - Viewed (0)
  2. okhttp-testing-support/src/main/kotlin/okhttp3/FakeProxySelector.kt

    import java.net.SocketAddress
    import java.net.URI
    
    class FakeProxySelector : ProxySelector() {
      val proxies: MutableList<Proxy> = mutableListOf()
    
      fun addProxy(proxy: Proxy): FakeProxySelector {
        proxies.add(proxy)
        return this
      }
    
      override fun select(uri: URI): List<Proxy> {
        // Don't handle 'socket' schemes, which the RI's Socket class may request (for SOCKS).
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.3K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

      fun redirectWithProxySelector() {
        val proxySelectionRequests: MutableList<URI> = ArrayList()
        client =
          client.newBuilder()
            .proxySelector(
              object : ProxySelector() {
                override fun select(uri: URI): List<Proxy> {
                  proxySelectionRequests.add(uri)
                  val proxyServer = if (uri.port == server.port) server else server2
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 131.7K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/SocksProxyTest.kt

        server.enqueue(MockResponse.Builder().body("abc").build())
        val proxySelector: ProxySelector =
          object : ProxySelector() {
            override fun select(uri: URI) = listOf(socksProxy.proxy())
    
            override fun connectFailed(
              uri: URI,
              socketAddress: SocketAddress,
              e: IOException,
            ) = error("unexpected call")
          }
        val client =
          clientTestRule.newClientBuilder()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  5. okhttp/src/main/kotlin/okhttp3/internal/proxy/NullProxySelector.kt

    import java.net.SocketAddress
    import java.net.URI
    
    /**
     * A proxy selector that always returns the [Proxy.NO_PROXY].
     */
    object NullProxySelector : ProxySelector() {
      override fun select(uri: URI?): List<Proxy> {
        requireNotNull(uri) { "uri must not be null" }
        return listOf(Proxy.NO_PROXY)
      }
    
      override fun connectFailed(
        uri: URI?,
        sa: SocketAddress?,
        ioe: IOException?,
      ) {
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.1K bytes
    - Viewed (0)
  6. okhttp/src/main/kotlin/okhttp3/HttpUrl.kt

       * These differences may have a significant consequence when the URI is interpreted by a
       * web server. For this reason the [URI class][URI] and this method should be avoided.
       */
      @JvmName("uri")
      fun toUri(): URI {
        val uri = newBuilder().reencodeForUri().toString()
        return try {
          URI(uri)
        } catch (e: URISyntaxException) {
          // Unlikely edge case: the URI has a forbidden character in the fragment. Strip it & retry.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 09 12:33:05 GMT 2024
    - 63.5K bytes
    - Viewed (1)
  7. container-tests/src/test/java/okhttp3/containers/BasicProxyTest.kt

     */
    package okhttp3.containers
    
    import assertk.assertThat
    import assertk.assertions.contains
    import assertk.assertions.isEqualTo
    import java.net.HttpURLConnection
    import java.net.Proxy
    import java.net.URI
    import javax.net.ssl.HttpsURLConnection
    import okhttp3.HttpUrl.Companion.toHttpUrl
    import okhttp3.OkHttpClient
    import okhttp3.Protocol
    import okhttp3.Request
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Apr 05 03:30:42 GMT 2024
    - 5.9K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/CookiesTest.kt

        server.enqueue(MockResponse())
        val serverUrl = urlWithIpAddress(server, "/")
        val androidCookieHandler: CookieHandler =
          object : CookieHandler() {
            override fun get(
              uri: URI,
              map: Map<String, List<String>>,
            ) = mapOf(
              "Cookie" to
                listOf(
                  "\$Version=\"1\"; " +
    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)
  9. okhttp/src/main/kotlin/okhttp3/internal/connection/RouteSelector.kt

          if (proxy != null) return listOf(proxy)
    
          // If the URI lacks a host (as in "http://</"), don't call the ProxySelector.
          val uri = url.toUri()
          if (uri.host == null) return immutableListOf(Proxy.NO_PROXY)
    
          // Try each of the ProxySelector choices until one connection succeeds.
          val proxiesOrNull = address.proxySelector.select(uri)
          if (proxiesOrNull.isNullOrEmpty()) return immutableListOf(Proxy.NO_PROXY)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Mar 06 17:33:38 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/KotlinDeprecationErrorTest.kt

        val level = interceptor.getLevel()
      }
    
      @Test @Disabled
      fun httpUrl() {
        val httpUrl: HttpUrl = HttpUrl.get("")
        val url: URL = httpUrl.url()
        val uri: URI = httpUrl.uri()
        val scheme: String = httpUrl.scheme()
        val encodedUsername: String = httpUrl.encodedUsername()
        val username: String = httpUrl.username()
        val encodedPassword: String = httpUrl.encodedPassword()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13.3K bytes
    - Viewed (0)
Back to top