Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for Responsecodes (0.05 sec)

  1. mockwebserver/src/test/java/mockwebserver3/CustomDispatcherTest.kt

      }
    
      private fun buildRequestThread(
        path: String,
        responseCode: AtomicInteger,
      ): Thread =
        Thread {
          val url = mockWebServer.url(path).toUrl()
          val conn: HttpURLConnection
          try {
            conn = url.openConnection() as HttpURLConnection
            responseCode.set(conn.responseCode) // Force the connection to hit the "server".
          } catch (ignored: IOException) {
          }
        }
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Jun 18 12:28:21 UTC 2025
    - 3.2K bytes
    - Viewed (0)
  2. samples/crawler/src/main/java/okhttp3/sample/Crawler.java

              + " over "
              + response.protocol()
              + ")") : "(cache)";
          int responseCode = response.code();
    
          System.out.printf("%03d: %s %s%n", responseCode, url, responseSource);
    
          String contentType = response.header("Content-Type");
          if (responseCode != 200 || contentType == null) {
            return;
          }
    
          MediaType mediaType = MediaType.parse(contentType);
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Jul 23 00:58:06 UTC 2025
    - 5K bytes
    - Viewed (0)
  3. src/test/java/jcifs/http/NtlmHttpURLConnectionTest.java

                    new ByteArrayInputStream(new byte[0]));
    
            // Act - Trigger handshake
            int responseCode = ntlmConnection.getResponseCode();
    
            // Assert - Verify we got the 401 response (simplified test)
            assertEquals(HTTP_UNAUTHORIZED, responseCode);
    
            // In a real scenario, the connection would reconnect and send Type1/Type3 messages
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 12.6K bytes
    - Viewed (0)
  4. mockwebserver/src/test/java/mockwebserver3/MockWebServerTest.kt

        val url = server.url("/").toUrl()
        val connection = url.openConnection() as HttpURLConnection
        assertThat(connection.responseCode).isEqualTo(HttpURLConnection.HTTP_OK)
        val refusedConnection = url.openConnection() as HttpURLConnection
        assertFailsWith<ConnectException> {
          refusedConnection.responseCode
        }.also { expected ->
          assertThat(expected.message!!).contains("refused")
        }
      }
    
      @Test
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sun Aug 03 22:38:00 UTC 2025
    - 28K bytes
    - Viewed (0)
  5. okhttp/src/jvmTest/kotlin/okhttp3/CacheTest.kt

        shouldWriteToCache: Boolean,
        responseCode: Int,
        method: String = "GET",
      ) {
        var expectedResponseCode = responseCode
        val server = MockWebServer()
        val builder =
          MockResponse
            .Builder()
            .addHeader("Last-Modified: " + formatDate(-1, TimeUnit.HOURS))
            .addHeader("Expires: " + formatDate(1, TimeUnit.HOURS))
            .code(responseCode)
            .body("ABCDE")
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 16 09:39:51 UTC 2025
    - 113.6K bytes
    - Viewed (0)
  6. okhttp/src/jvmTest/kotlin/okhttp3/URLConnectionTest.kt

        val proxy = authHeader.startsWith("Proxy-")
        val responseCode = if (proxy) 407 else 401
        val authenticator = RecordingAuthenticator(null)
        java.net.Authenticator.setDefault(authenticator)
        server.enqueue(
          MockResponse
            .Builder()
            .code(responseCode)
            .addHeader(authHeader)
            .body("Please authenticate.")
            .build(),
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Jun 21 20:36:35 UTC 2025
    - 133.2K bytes
    - Viewed (0)
Back to top