- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 38 for onResponse (0.07 seconds)
-
samples/guide/src/main/java/okhttp3/recipes/PrintEvents.java
.build(); client.newCall(washingtonPostRequest).enqueue(new Callback() { @Override public void onFailure(Call call, IOException e) { } @Override public void onResponse(Call call, Response response) throws IOException { try (ResponseBody body = response.body()) { // Consume and discard the response body. body.source().readByteString(); } }
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Sun Feb 16 23:20:49 GMT 2020 - 6.1K bytes - Click Count (0) -
samples/guide/src/main/java/okhttp3/recipes/kt/AsynchronousGet.kt
object : Callback { override fun onFailure( call: Call, e: IOException, ) { e.printStackTrace() } override fun onResponse( call: Call, response: Response, ) { response.use { if (!response.isSuccessful) throw IOException("Unexpected code $response")Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Wed Mar 19 19:25:20 GMT 2025 - 1.6K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/okhttp3/WholeOperationTimeoutTest.kt
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Wed Jun 18 12:28:21 GMT 2025 - 10.6K bytes - Click Count (0) -
okhttp-coroutines/src/main/kotlin/okhttp3/coroutines/ExecuteAsync.kt
object : Callback { override fun onFailure( call: Call, e: IOException, ) { continuation.resumeWithException(e) } override fun onResponse( call: Call, response: Response, ) { continuation.resume(response) { _, value, _ -> value.closeQuietly() } } }, )Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Thu Jun 19 04:20:30 GMT 2025 - 1.4K bytes - Click Count (1) -
okhttp/src/jvmTest/kotlin/okhttp3/DispatcherCleanupTest.kt
val okhttp = OkHttpClient() val callback = object : Callback { override fun onFailure( call: Call, e: IOException, ) {} override fun onResponse( call: Call, response: Response, ) { response.close() } } repeat(10_000) {
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Wed Jun 18 12:28:21 GMT 2025 - 1.3K bytes - Click Count (0) -
samples/guide/src/main/java/okhttp3/recipes/AsynchronousGet.java
.build(); client.newCall(request).enqueue(new Callback() { @Override public void onFailure(Call call, IOException e) { e.printStackTrace(); } @Override public void onResponse(Call call, Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Sun May 22 01:29:42 GMT 2016 - 1.9K bytes - Click Count (0) -
okhttp-sse/src/main/kotlin/okhttp3/sse/internal/RealEventSource.kt
@Volatile private var canceled = false fun connect(callFactory: Call.Factory) { call = callFactory.newCall(request).apply { enqueue(this@RealEventSource) } } override fun onResponse( call: Call, response: Response, ) { processResponse(response) } fun processResponse(response: Response) { response.use { if (!response.isSuccessful) {
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Fri Oct 03 07:51:20 GMT 2025 - 3.2K bytes - Click Count (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/Callback.kt
* necessarily indicate application-layer success: `response` may still indicate an unhappy HTTP * response code like 404 or 500. */ @Throws(IOException::class) fun onResponse( call: Call, response: Response, )Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Fri Dec 27 13:39:56 GMT 2024 - 1.6K bytes - Click Count (0) -
android-test-app/src/main/kotlin/okhttp/android/testapp/MainActivity.kt
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Tue Aug 19 08:10:39 GMT 2025 - 1.7K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/okhttp3/RecordingCallback.kt
call: Call, e: IOException, ) { responses.add(RecordedResponse(call.request(), null, null, null, e)) (this as Object).notifyAll() } @Synchronized override fun onResponse( call: Call, response: Response, ) { val body = response.body.string() responses.add(RecordedResponse(call.request(), response, null, body, null)) (this as Object).notifyAll() }Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Fri Dec 27 13:39:56 GMT 2024 - 2.1K bytes - Click Count (0)