Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 36 for behavior (0.39 sec)

  1. docs/changelogs/changelog_4x.md

     *  Fix: Follow HTTP 307 and 308 redirects on methods other than GET and POST. We're reluctant to
        change OkHttp's behavior in handling common HTTP status codes, but this fix is overdue! The new
        behavior is now consistent with [RFC 7231][rfc_7231_647], which is newer than OkHttp itself.
        If you want this update with the old behavior use [this interceptor][legacy_interceptor].
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Wed Apr 17 13:25:31 GMT 2024
    - 25.2K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/Interceptor.kt

     *    thread's [uncaught exception handler][Thread.UncaughtExceptionHandler]. By default this
     *    crashes the application on Android and prints a stacktrace on the JVM. (Crash reporting
     *    libraries may customize this behavior.)
     *
     * A good way to signal a failure is with a synthetic HTTP response:
     *
     * ```kotlin
     *   @Throws(IOException::class)
     *   override fun intercept(chain: Interceptor.Chain): Response {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/internal/ws/WebSocketWriterTest.kt

          assertThat(data.readByteString().hex(), "Data not empty")
            .isEqualTo("")
        }
    
      // Mutually exclusive. Use the one corresponding to the peer whose behavior you wish to test.
      private val serverWriter =
        WebSocketWriter(
          isClient = false,
          sink = data,
          random = random,
          perMessageDeflate = false,
          noContextTakeover = false,
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

            readAscii(response.body.byteStream(), Int.MAX_VALUE)
          }
        }
      }
    
      /**
       * This test checks whether connections are gzipped by default. This behavior in not required by
       * the API, so a failure of this test does not imply a bug in the implementation.
       */
      @Test
      fun gzipEncodingEnabledByDefault() {
        server.enqueue(
          MockResponse.Builder()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 131.7K bytes
    - Viewed (0)
  5. regression-test/src/androidTest/java/okhttp/regression/compare/ApacheHttpClientHttp2Test.kt

    /**
     * Simplified from
     * https://hc.apache.org/httpcomponents-client-5.0.x/httpclient5/examples/AsyncClientTlsAlpn.java
     *
     * Mainly intended to verify behaviour of popular clients across Android versions, similar
     * to observing Firefox or Chrome browser behaviour.
     */
    class ApacheHttpClientHttp2Test {
      @Test
      fun testHttp2() {
        val client = HttpAsyncClients.createHttp2Default()
    
        client.use { client ->
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.6K bytes
    - Viewed (0)
  6. samples/compare/src/test/kotlin/okhttp3/compare/ApacheHttpClientTest.kt

    import org.junit.jupiter.api.Test
    
    /**
     * Apache HttpClient 5.x.
     *
     * https://hc.apache.org/httpcomponents-client-5.0.x/index.html
     *
     * Baseline test if we ned to validate OkHttp behaviour against other popular clients.
     */
    class ApacheHttpClientTest {
      private val httpClient = HttpClients.createDefault()
    
      @AfterEach fun tearDown() {
        httpClient.close()
      }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/Dns.kt

            try {
              return InetAddress.getAllByName(hostname).toList()
            } catch (e: NullPointerException) {
              throw UnknownHostException("Broken system behaviour for dns lookup of $hostname").apply {
                initCause(e)
              }
            }
          }
        }
      }
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.2K bytes
    - Viewed (0)
  8. samples/compare/src/test/kotlin/okhttp3/compare/JavaHttpClientTest.kt

    import org.junit.jupiter.api.extension.RegisterExtension
    
    /**
     * Java HTTP Client.
     *
     * https://openjdk.java.net/groups/net/httpclient/intro.html
     *
     * Baseline test if we ned to validate OkHttp behaviour against other popular clients.
     */
    class JavaHttpClientTest {
      @JvmField @RegisterExtension
      val platform = PlatformRule()
    
      @Test fun get(server: MockWebServer) {
        // Not available
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/internal/idn/StringprepTest.kt

        assertThat(stringPrep("\udbff\udffe")).isNull()
      }
    
      /**
       * Because our API always transcodes through UTF-8, and that transcoding replaces unpaired
       * surrogates with '?', we can't test this behavior with Java Strings. Instead, pass the surrogate
       * code itself encoded as UTF-8 sequence.
       */
      @Test fun prohibitionSurrogateCodes() {
        // UTF-8 encoding of the high surrogate U+D800.
    Plain Text
    - Registered: Fri Mar 29 11:42:11 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.7K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/internal/idn/IdnaMappingTableTest.kt

      }
    
      @Test fun binarySearchEmptyRange() {
        assertEquals(-1, binarySearch(0, 0) { error("unexpected call") })
      }
    
      /** Confirm the compact table has the exact same behavior as the plain table. */
      @Test fun comparePlainAndCompactTables() {
        val buffer = Buffer()
        for (codePoint in 0..0x10ffff) {
          val allowedByTable = table.map(codePoint, buffer)
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 8.9K bytes
    - Viewed (0)
Back to top