- Sort Score
- Result 10 results
- Languages All
Results 1 - 9 of 9 for eventListenerFactory (0.22 sec)
-
samples/guide/src/main/java/okhttp3/recipes/PrintEvents.java
import okhttp3.Protocol; import okhttp3.Request; import okhttp3.Response; import okhttp3.ResponseBody; public final class PrintEvents { private final OkHttpClient client = new OkHttpClient.Builder() .eventListenerFactory(PrintingEventListener.FACTORY) .build(); public void run() throws Exception { Request washingtonPostRequest = new Request.Builder() .url("https://www.washingtonpost.com/") .build();
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sun Feb 16 23:20:49 UTC 2020 - 6.1K bytes - Viewed (0) -
okcurl/src/main/kotlin/okhttp3/curl/Main.kt
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Wed Mar 19 19:25:20 UTC 2025 - 6K bytes - Viewed (0) -
android-test/src/test/kotlin/okhttp/android/test/AndroidLoggingTest.kt
) // We should consider if these logs should retain Exceptions assertThat(logs.last().throwable).isNull() } @Test fun testLoggingEventListener() { val client = clientBuilder.eventListenerFactory(LoggingEventListener.Factory()).build() try { client.newCall(request).execute() } catch (uhe: UnknownHostException) { // expected }
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Thu Aug 21 14:27:04 UTC 2025 - 3.2K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/okhttp3/internal/http/HttpUpgradesTest.kt
private var listener = RecordingEventListener() private val handshakeCertificates = platform.localhostHandshakeCertificates() private var client = clientTestRule .newClientBuilder() .eventListenerFactory(clientTestRule.wrap(listener)) .build() @Test fun upgrade() { val socketHandler = MockSocketHandler() .apply { receiveRequest("client says hello\n")
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Thu Jul 31 04:18:40 UTC 2025 - 7.1K bytes - Viewed (0) -
okhttp-logging-interceptor/src/main/kotlin/okhttp3/logging/LoggingEventListener.kt
import okhttp3.OkHttpClient import okhttp3.Protocol import okhttp3.Request import okhttp3.Response /** * An OkHttp EventListener, which logs call events. Can be applied as an * [event listener factory][OkHttpClient.eventListenerFactory]. * * The format of the logs created by this class should not be considered stable and may change * slightly between releases. If you need a stable logging format, use your own event listener. */
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Mon Apr 01 11:07:32 UTC 2024 - 5.4K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/okhttp3/SessionReuseTest.kt
this.enableSessionCreation = false } } } client = client .newBuilder() .connectionSpecs(listOf(spec)) .eventListenerFactory( clientTestRule.wrap( object : EventListener() { override fun connectionAcquired( call: Call, connection: Connection, ) {
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Wed Jun 18 12:28:21 UTC 2025 - 6K bytes - Viewed (1) -
okhttp/src/jvmTest/kotlin/okhttp3/JSSETest.kt
} @Test @Disabled fun testFacebook() { val sessionIds = mutableListOf<String>() assumeNetwork() client = client .newBuilder() .eventListenerFactory( clientTestRule.wrap( object : EventListener() { override fun connectionAcquired( call: Call, connection: Connection, ) {
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Wed Jun 18 12:28:21 UTC 2025 - 5.5K bytes - Viewed (0) -
okhttp-sse/src/test/java/okhttp3/sse/internal/EventSourceHttpTest.kt
private val eventListener = RecordingEventListener() private val listener = EventSourceRecorder() private var client = clientTestRule .newClientBuilder() .eventListenerFactory(clientTestRule.wrap(eventListener)) .build() @AfterEach fun after() { listener.assertExhausted() } @Test fun event() { server.enqueue( MockResponse
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Aug 30 11:47:47 UTC 2025 - 8.1K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/okhttp3/ServerTruncatesRequestTest.kt
private val listener = RecordingEventListener() private val handshakeCertificates = platform.localhostHandshakeCertificates() private var client = clientTestRule .newClientBuilder() .eventListenerFactory(clientTestRule.wrap(listener)) .build() @StartStop private val server = MockWebServer() @BeforeEach fun setUp() { platform.assumeNotOpenJSSE() platform.assumeHttp2Support()
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Fri Jun 20 11:46:46 UTC 2025 - 9.4K bytes - Viewed (0)