Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 33 for uri (0.15 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. samples/slack/src/main/java/okhttp3/slack/SlackApi.java

        HttpUrl.Builder builder = baseUrl.newBuilder("/oauth/authorize")
            .addQueryParameter("client_id", clientId)
            .addQueryParameter("scope", scopes)
            .addQueryParameter("redirect_uri", redirectUrl.toString())
            .addQueryParameter("state", state.base64());
    
        if (team != null) {
          builder.addQueryParameter("team", team);
        }
    
        return builder.build();
      }
    
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Jul 06 19:30:55 GMT 2018
    - 4.4K bytes
    - Viewed (1)
  4. 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)
  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. 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)
  7. 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)
  8. okhttp/src/test/java/okhttp3/internal/connection/RouteSelectorTest.kt

        val nullProxySelector: ProxySelector =
          object : ProxySelector() {
            override fun select(uri: URI): List<Proxy>? {
              assertThat(uri.host).isEqualTo(uriHost)
              return null
            }
    
            override fun connectFailed(
              uri: URI,
              socketAddress: SocketAddress,
              e: IOException,
            ) {
              throw AssertionError()
            }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Mar 06 17:33:38 GMT 2024
    - 20.8K bytes
    - Viewed (0)
  9. 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)
  10. 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)
Back to top