Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 5 of 5 for HTTP_UNAUTHORIZED (0.25 seconds)

  1. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/http/RetryAndFollowUpInterceptor.kt

    import java.net.HttpURLConnection.HTTP_MULT_CHOICE
    import java.net.HttpURLConnection.HTTP_PROXY_AUTH
    import java.net.HttpURLConnection.HTTP_SEE_OTHER
    import java.net.HttpURLConnection.HTTP_UNAUTHORIZED
    import java.net.HttpURLConnection.HTTP_UNAVAILABLE
    import java.net.ProtocolException
    import java.net.Proxy
    import java.net.SocketTimeoutException
    import java.security.cert.CertificateException
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Tue Jan 27 09:00:39 GMT 2026
    - 12.5K bytes
    - Click Count (0)
  2. okhttp/src/jvmTest/kotlin/okhttp3/DuplexTest.kt

            .requestIOException()
            .exhaustResponse()
        server.enqueue(
          MockResponse
            .Builder()
            .clearHeaders()
            .code(HttpURLConnection.HTTP_UNAUTHORIZED)
            .socketHandler(body1)
            .build(),
        )
        val body =
          MockSocketHandler()
            .sendResponse("response body\n")
            .exhaustResponse()
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Tue Nov 04 19:13:52 GMT 2025
    - 25.8K bytes
    - Click Count (0)
  3. okhttp/src/jvmTest/kotlin/okhttp3/internal/http2/HttpOverHttp2Test.kt

        assertThat(response.body.string()).isEqualTo("ABCABCABC")
      }
    
      @Test
      fun authenticate() {
        server.enqueue(
          MockResponse(
            code = HttpURLConnection.HTTP_UNAUTHORIZED,
            headers = headersOf("www-authenticate", "Basic realm=\"protected area\""),
            body = "Please authenticate.",
          ),
        )
        server.enqueue(
          MockResponse(body = "Successful auth!"),
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Tue Jan 27 09:00:39 GMT 2026
    - 67.5K bytes
    - Click Count (0)
  4. okhttp/src/jvmTest/kotlin/okhttp3/CacheTest.kt

        when (responseCode) {
          HttpURLConnection.HTTP_PROXY_AUTH -> {
            builder.addHeader("Proxy-Authenticate: Basic realm=\"protected area\"")
          }
    
          HttpURLConnection.HTTP_UNAUTHORIZED -> {
            builder.addHeader("WWW-Authenticate: Basic realm=\"protected area\"")
          }
    
          HttpURLConnection.HTTP_NO_CONTENT, HttpURLConnection.HTTP_RESET -> {
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Fri Mar 20 09:13:37 GMT 2026
    - 121K bytes
    - Click Count (0)
  5. okhttp/src/jvmTest/kotlin/okhttp3/URLConnectionTest.kt

       * new HTTP request to be issued for every call into the URLConnection.
       */
      @Test
      fun unauthorizedResponseHandling() {
        val mockResponse =
          MockResponse(
            code = HttpURLConnection.HTTP_UNAUTHORIZED,
            headers = headersOf("WWW-Authenticate", "challenge"),
            body = "Unauthorized",
          )
        server.enqueue(mockResponse)
        server.enqueue(mockResponse)
        server.enqueue(mockResponse)
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Tue Jan 27 09:00:39 GMT 2026
    - 133.3K bytes
    - Click Count (0)
Back to Top