- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 155 for OkHttpClient (0.08 sec)
-
okhttp-android/src/test/kotlin/okhttp3/android/RobolectricOkHttpClientTest.kt
@Config( sdk = [30], ) class RobolectricOkHttpClientTest { private lateinit var context: Context private lateinit var client: OkHttpClient @Before fun setUp() { context = ApplicationProvider.getApplicationContext<Application>() client = OkHttpClient.Builder() .cache(Cache(FakeFileSystem(), "/cache".toPath(), 10_000_000)) .build() } @Test fun testRequestExternal() {
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Wed Apr 10 19:46:48 UTC 2024 - 2.5K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/RewriteResponseCacheControl.java
.header("Cache-Control", "max-age=60") .build(); }; private final OkHttpClient client; public RewriteResponseCacheControl(File cacheDirectory) throws Exception { Cache cache = new Cache(cacheDirectory, 1024 * 1024); cache.evictAll(); client = new OkHttpClient.Builder() .cache(cache) .build(); } public void run() throws Exception {
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sat Jan 12 03:31:36 UTC 2019 - 2.6K bytes - Viewed (0) -
container-tests/src/test/java/okhttp3/containers/BasicMockServerTest.kt
} } companion object { val MOCKSERVER_IMAGE: DockerImageName = DockerImageName .parse("mockserver/mockserver") .withTag("mockserver-5.15.0") fun OkHttpClient.Builder.trustMockServer(): OkHttpClient.Builder = apply { val keyStoreFactory = KeyStoreFactory(Configuration.configuration(), MockServerLogger()) val socketFactory = keyStoreFactory.sslContext().socketFactory
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Fri Apr 05 03:30:42 UTC 2024 - 3.3K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/PostStreaming.java
import java.io.IOException; import okhttp3.MediaType; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; import okio.BufferedSink; public final class PostStreaming { public static final MediaType MEDIA_TYPE_MARKDOWN = MediaType.get("text/x-markdown; charset=utf-8"); private final OkHttpClient client = new OkHttpClient(); public void run() throws Exception {
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Fri Jul 06 03:18:15 UTC 2018 - 2.1K bytes - Viewed (0) -
samples/crawler/src/main/java/okhttp3/sample/Crawler.java
import okhttp3.HttpUrl; import okhttp3.MediaType; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; /** * Fetches HTML from a requested URL, follows the links, and repeats. */ public final class Crawler { private final OkHttpClient client;
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Thu Aug 12 07:26:27 UTC 2021 - 4.6K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/PostForm.java
*/ package okhttp3.recipes; import java.io.IOException; import okhttp3.FormBody; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; public final class PostForm { private final OkHttpClient client = new OkHttpClient(); public void run() throws Exception { RequestBody formBody = new FormBody.Builder() .add("search", "Jurassic Park")
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sun May 22 01:29:42 UTC 2016 - 1.4K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/TestTls13Request.kt
private fun testClient( urls: List<String>, client: OkHttpClient, ) { try { for (url in urls) { sendRequest(client, url) } } finally { client.dispatcher.executorService.shutdownNow() client.connectionPool.evictAll() } } private fun buildClient(vararg specs: ConnectionSpec): OkHttpClient { return OkHttpClient.Builder() .connectionSpecs(listOf(*specs)) .build() }
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 3K bytes - Viewed (0) -
okhttp-brotli/README.md
provided Accept-Encoding is not set previously. Modern web servers must choose to return Brotli responses. n.b. It is not used for sending requests. ```java OkHttpClient client = new OkHttpClient.Builder() .addInterceptor(BrotliInterceptor.INSTANCE) .build(); ``` ```kotlin implementation("com.squareup.okhttp3:okhttp-brotli:4.12.0") ```
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sun Dec 17 15:34:10 UTC 2023 - 572 bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/kt/ConfigureTimeouts.kt
* limitations under the License. */ package okhttp3.recipes.kt import java.util.concurrent.TimeUnit import okhttp3.OkHttpClient import okhttp3.Request class ConfigureTimeouts { private val client: OkHttpClient = OkHttpClient.Builder() .connectTimeout(5, TimeUnit.SECONDS) .writeTimeout(5, TimeUnit.SECONDS) .readTimeout(5, TimeUnit.SECONDS)
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 1.3K bytes - Viewed (0) -
okhttp-android/src/androidTest/kotlin/okhttp3/android/AndroidAsyncDnsTest.kt
import java.util.concurrent.CountDownLatch import mockwebserver3.MockResponse import mockwebserver3.junit4.MockWebServerRule import okhttp3.AsyncDns import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.tls.HandshakeCertificates import okhttp3.tls.HeldCertificate import okio.IOException import org.junit.Assume.assumeTrue import org.junit.AssumptionViolatedException
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 5.7K bytes - Viewed (0)