- Sort Score
- Result 10 results
- Languages All
Results 121 - 130 of 361 for clientIp (0.06 sec)
-
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 Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Jan 12 03:31:36 UTC 2019 - 2.6K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/guide/GetExample.java
import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; public class GetExample { final OkHttpClient client = new OkHttpClient(); String run(String url) throws IOException { Request request = new Request.Builder() .url(url) .build(); try (Response response = client.newCall(request).execute()) { return response.body().string(); } }
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Fri Apr 05 03:30:42 UTC 2024 - 1.3K bytes - Viewed (0) -
okhttp-coroutines/src/test/kotlin/okhttp3/coroutines/ExecuteAsyncTest.kt
val clientTestRule = OkHttpClientTestRule() private var client = clientTestRule.newClientBuilder().build() @StartStop private val server = MockWebServer() val request by lazy { Request(server.url("/")) } @Test fun suspendCall() { runTest { server.enqueue(MockResponse(body = "abc")) val call = client.newCall(request) call.executeAsync().use {
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Fri Jun 20 11:46:46 UTC 2025 - 5.3K bytes - Viewed (0) -
regression-test/src/androidTest/java/okhttp/regression/compare/OkHttpClientTest.java
*/ @RunWith(AndroidJUnit4.class) public class OkHttpClientTest { @Test public void get() throws IOException { OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://google.com/robots.txt") .build(); try (Response response = client.newCall(request).execute()) { assertEquals(200, response.code()); assertEquals(Protocol.HTTP_2, response.protocol()); }
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Nov 14 17:38:22 UTC 2020 - 1.4K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/kt/AsynchronousGet.kt
import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.Response class AsynchronousGet { private val client = OkHttpClient() fun run() { val request = Request .Builder() .url("http://publicobject.com/helloworld.txt") .build() client.newCall(request).enqueue( object : Callback { override fun onFailure( call: Call,
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Wed Mar 19 19:25:20 UTC 2025 - 1.6K bytes - Viewed (0) -
container-tests/src/test/java/okhttp3/containers/BasicMockServerTest.kt
import javax.net.ssl.TrustManagerFactory import javax.net.ssl.X509TrustManager import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient import okhttp3.Request import org.junit.jupiter.api.Test import org.mockserver.client.MockServerClient import org.mockserver.configuration.Configuration import org.mockserver.logging.MockServerLogger import org.mockserver.model.HttpRequest.request import org.mockserver.model.HttpResponse.response
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Wed Mar 19 19:25:20 UTC 2025 - 3.4K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/okhttp3/ServerTruncatesRequestTest.kt
} } private fun enableProtocol(protocol: Protocol) { enableTls() client = client .newBuilder() .protocols(listOf(protocol, Protocol.HTTP_1_1)) .build() server.protocols = client.protocols } private fun enableTls() { client = client .newBuilder() .sslSocketFactory( handshakeCertificates.sslSocketFactory(),
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Fri Jun 20 11:46:46 UTC 2025 - 9.4K bytes - Viewed (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/Handshake.kt
import java.security.cert.X509Certificate import javax.net.ssl.SSLPeerUnverifiedException import javax.net.ssl.SSLSession import okhttp3.internal.toImmutableList /** * A record of a TLS handshake. For HTTPS clients, the client is *local* and the remote server is * its *peer*. * * This value object describes a completed handshake. Use [ConnectionSpec] to set policy for new * handshakes. */ class Handshake internal constructor(
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Apr 05 09:48:10 UTC 2025 - 6.6K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/okhttp3/SessionReuseTest.kt
server.enqueue(MockResponse(body = "abc2")) val request = Request(server.url("/")) client.newCall(request).execute().use { response -> assertEquals(200, response.code) } client.connectionPool.evictAll() assertEquals(0, client.connectionPool.connectionCount()) // Force reuse. This appears flaky (30% of the time) even though sessions are reused.
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Wed Jun 18 12:28:21 UTC 2025 - 6K bytes - Viewed (0) -
okhttp-sse/src/main/kotlin/okhttp3/sse/EventSources.kt
object EventSources { @Deprecated( message = "required for binary-compatibility!", level = DeprecationLevel.HIDDEN, ) @JvmStatic fun createFactory(client: OkHttpClient) = client.asEventSourceFactory() @Deprecated( message = "Moved to extension function.", replaceWith = ReplaceWith( expression = "callFactory.asEventSourceFactory()",
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Aug 30 11:47:47 UTC 2025 - 1.8K bytes - Viewed (0)