Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 24 for username (0.35 sec)

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

      }
    
      @Test
      fun toJavaNetUrl() {
        val httpUrl = "http://username:password@host/path?query#fragment".toHttpUrl()
        val javaNetUrl = httpUrl.toUrl()
        assertThat(javaNetUrl.toString())
          .isEqualTo("http://username:password@host/path?query#fragment")
      }
    
      @Test
      fun toUri() {
        val httpUrl = "http://username:password@host/path?query#fragment".toHttpUrl()
        val uri = httpUrl.toUri()
    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/src/test/java/okhttp3/internal/RecordingAuthenticator.kt

    package okhttp3.internal
    
    import java.net.Authenticator
    import java.net.PasswordAuthentication
    
    class RecordingAuthenticator(
      private val authentication: PasswordAuthentication? =
        PasswordAuthentication(
          "username",
          "password".toCharArray(),
        ),
    ) : Authenticator() {
      val calls = mutableListOf<String>()
    
      override fun getPasswordAuthentication(): PasswordAuthentication? {
        calls.add(
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.4K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/HttpUrlTest.kt

        assertThat(httpUrl.username).isEqualTo("foo")
        assertThat(httpUrl.password).isEqualTo("pass1@bar:pass2")
        assertThat(httpUrl).isEqualTo(parse("http://foo:pass1%40bar%3Apass2@baz/path"))
      }
    
      @Test
      fun usernameAndPassword() {
        assertThat(parse("http://username:password@host/path"))
          .isEqualTo(parse("http://username:password@host/path"))
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 67.9K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/Credentials.kt

    object Credentials {
      /** Returns an auth credential for the Basic scheme. */
      @JvmStatic @JvmOverloads
      fun basic(
        username: String,
        password: String,
        charset: Charset = ISO_8859_1,
      ): String {
        val usernameAndPassword = "$username:$password"
        val encoded = usernameAndPassword.encode(charset).base64()
        return "Basic $encoded"
      }
    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)
  5. okhttp/src/main/kotlin/okhttp3/HttpUrl.kt

      /**
       * The decoded username, or an empty string if none is present.
       *
       * | URL                              | `username()` |
       * | :------------------------------- | :----------- |
       * | `http://host/`                   | `""`         |
       * | `http://username@host/`          | `"username"` |
       * | `http://username:password@host/` | `"username"` |
       * | `http://a%20b:c%20d@host/`       | `"a b"`      |
    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)
  6. samples/guide/src/main/java/okhttp3/recipes/PreemptiveAuth.java

      static final class BasicAuthInterceptor implements Interceptor {
        private final String credentials;
        private final String host;
    
        BasicAuthInterceptor(String host, String username, String password) {
          this.credentials = Credentials.basic(username, password);
          this.host = host;
        }
    
        @Override public Response intercept(Chain chain) throws IOException {
          Request request = chain.request();
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Nov 05 07:46:46 GMT 2018
    - 2.1K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

          ),
        )
        server.enqueue(
          MockResponse(body = "Successful auth!"),
        )
        java.net.Authenticator.setDefault(
          RecordingAuthenticator(
            PasswordAuthentication("username", "mötorhead".toCharArray()),
          ),
        )
        client =
          client.newBuilder()
            .authenticator(JavaNetAuthenticator())
            .build()
        val response = getResponse(newRequest("/"))
    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)
  8. okhttp/src/test/java/okhttp3/WebPlatformUrlTestData.kt

      var base: String? = null
      var scheme = ""
      var username = ""
      var password: String? = null
      var host = ""
      var port = ""
      var path = ""
      var query = ""
      var fragment = ""
    
      fun expectParseFailure() = scheme.isEmpty()
    
      private operator fun set(
        name: String,
        value: String,
      ) {
        when (name) {
          "s" -> scheme = value
          "u" -> username = value
          "pass" -> password = value
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/KotlinDeprecationErrorTest.kt

        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()
        val password: String = httpUrl.password()
        val host: String = httpUrl.host()
        val port: Int = httpUrl.port()
    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)
  10. okhttp/src/main/kotlin/okhttp3/internal/authenticator/JavaNetAuthenticator.kt

              )
            }
    
          if (auth != null) {
            val credentialHeader = if (proxyAuthorization) "Proxy-Authorization" else "Authorization"
            val credential =
              Credentials.basic(
                auth.userName,
                String(auth.password),
                challenge.charset,
              )
            return request.newBuilder()
              .header(credentialHeader, credential)
              .build()
          }
        }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.2K bytes
    - Viewed (0)
Back to top