Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 47 for replace (0.51 sec)

  1. samples/guide/src/test/kotlin/okhttp3/AllMainsTest.kt

        val mainFiles = mainFiles()
        return mainFiles.map {
          val suffix = it.path.replace("${prefix}samples/guide/src/main/java/", "")
          suffix.replace("(.*)\\.java".toRegex()) { mr ->
            mr.groupValues[1].replace('/', '.')
          }.replace("(.*)\\.kt".toRegex()) { mr ->
            mr.groupValues[1].replace('/', '.') + "Kt"
          }
        }.sorted()
      }
    }
    
    @Disabled("Don't run by default")
    @Tag("Slow")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/CacheCorruptionTest.kt

          cache.delete()
        }
      }
    
      @Test
      fun corruptedCipher() {
        val response =
          testCorruptingCache {
            corruptMetadata {
              // mess with cipher suite
              it.replace("TLS_", "SLT_")
            }
          }
    
        assertThat(response.body.string()).isEqualTo("ABC.1") // cached
        assertThat(cache.requestCount()).isEqualTo(2)
        assertThat(cache.networkCount()).isEqualTo(1)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 6K bytes
    - Viewed (1)
  3. okhttp-logging-interceptor/src/test/java/okhttp3/logging/HttpLoggingInterceptorTest.kt

              request()
                .build(),
            )
            .execute()
        response.body.close()
        val redactedUrl = networkInterceptor.redactUrl(url)
        val redactedUrlPattern = redactedUrl.replace("?", """\?""")
        applicationLogs
          .assertLogEqual("--> GET $redactedUrl")
          .assertLogMatch(Regex("""<-- 200 OK $redactedUrlPattern \(\d+ms, \d+-byte body\)"""))
          .assertNoMoreLogs()
        networkLogs
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 09:14:38 GMT 2024
    - 37.6K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/Request.kt

         *
         * Note that for some headers including `Content-Length` and `Content-Encoding`,
         * OkHttp may replace [value] with a header derived from the request body.
         */
        open fun addHeader(
          name: String,
          value: String,
        ) = commonAddHeader(name, value)
    
        /** Removes all headers named [name] on this builder. */
        open fun removeHeader(name: String) = commonRemoveHeader(name)
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 04:17:44 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  5. okhttp/src/main/kotlin/okhttp3/internal/http2/Http2.kt

        return when {
          type == TYPE_PUSH_PROMISE && flags and FLAG_END_PUSH_PROMISE != 0 -> {
            result.replace("HEADERS", "PUSH_PROMISE") // TODO: Avoid allocation.
          }
          type == TYPE_DATA && flags and FLAG_COMPRESSED != 0 -> {
            result.replace("PRIORITY", "COMPRESSED") // TODO: Avoid allocation.
          }
          else -> result
        }
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.7K bytes
    - Viewed (0)
  6. okhttp-android/src/test/kotlin/okhttp3/android/AndroidLoggingTest.kt

          // expected
        }
    
        val logs = ShadowLog.getLogsForTag("testLoggingEventListener")
        assertThat(logs.map { it.type }).containsOnly(Log.INFO)
        assertThat(
          logs.map {
            it.msg.replace(
              "\\[\\d+ ms] ".toRegex(),
              "",
            )
          },
        ).containsExactly(
          "callStart: Request{method=GET, url=http://google.com/robots.txt}",
          "proxySelectStart: http://google.com/",
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 01 11:07:32 GMT 2024
    - 3.2K bytes
    - Viewed (0)
  7. docs/changelogs/changelog_3x.md

        HTTP requests, you can use this interface to replace the real `OkHttpClient`
        with your own mocks or fakes.
    
        The interface will also let you use OkHttp's API with another HTTP client's
        implementation. This is useful in sandboxed environments like Google App
        Engine.
    
     *  **OkHttp now does cookies.** We've replaced `java.net.CookieHandler` with
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 14:55:54 GMT 2022
    - 50.8K bytes
    - Viewed (0)
  8. okhttp-sse/src/main/kotlin/okhttp3/sse/internal/RealEventSource.kt

              response,
            )
            return
          }
    
          // This is a long-lived response. Cancel full-call timeouts.
          call?.timeout()?.cancel()
    
          // Replace the body with a stripped one so the callbacks can't see real data.
          val response = response.stripBody()
    
          val reader = ServerSentEventReader(body.source(), this)
          try {
            if (!canceled) {
    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)
  9. okhttp/src/main/kotlin/okhttp3/HttpUrl.kt

        return try {
          URI(uri)
        } catch (e: URISyntaxException) {
          // Unlikely edge case: the URI has a forbidden character in the fragment. Strip it & retry.
          try {
            val stripped = uri.replace(Regex("[\\u0000-\\u001F\\u007F-\\u009F\\p{javaWhitespace}]"), "")
            URI.create(stripped)
          } catch (e1: Exception) {
            throw RuntimeException(e) // Unexpected!
          }
        }
      }
    
      /**
    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)
  10. docs/features/interceptors.md

     * Observe the data just as it will be transmitted over the network.
     * Access to the `Connection` that carries the request.
    
    ### Rewriting Requests
    
    Interceptors can add, remove, or replace request headers. They can also transform the body of those requests that have one. For example, you can use an application interceptor to add request body compression if you're connecting to a webserver known to support it.
    
    ```java
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 02:19:09 GMT 2022
    - 8.1K bytes
    - Viewed (0)
Back to top