Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for executeSync (0.18 sec)

  1. README.md

    try (CurlResponse response = Curl.get("https://example.com")
                                    .param("q", "curl4j")
                                    .header("Accept", "application/json")
                                    .executeSync()) {
        System.out.println("Status: " + response.getHttpStatusCode());
        System.out.println(response.getContentAsString());
    }
    ```
    
    ### Asynchronous request
    
    ```java
    import org.codelibs.curl.Curl;
    
    Registered: Thu Sep 04 15:34:10 UTC 2025
    - Last Modified: Sat Jul 05 01:11:14 UTC 2025
    - 2.5K bytes
    - Viewed (0)
  2. okhttp-coroutines/src/main/kotlin/okhttp3/coroutines/ExecuteAsync.kt

    import kotlinx.coroutines.suspendCancellableCoroutine
    import okhttp3.Call
    import okhttp3.Callback
    import okhttp3.Response
    import okhttp3.internal.closeQuietly
    import okio.IOException
    
    suspend fun Call.executeAsync(): Response =
      suspendCancellableCoroutine { continuation ->
        continuation.invokeOnCancellation {
          this.cancel()
        }
        this.enqueue(
          object : Callback {
            override fun onFailure(
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu Jun 19 04:20:30 UTC 2025
    - 1.4K bytes
    - Viewed (0)
  3. okhttp-coroutines/src/test/kotlin/okhttp3/coroutines/ExecuteAsyncTest.kt

      val request by lazy { Request(server.url("/")) }
    
      @Test
      fun suspendCall() {
        runTest {
          server.enqueue(MockResponse(body = "abc"))
    
          val call = client.newCall(request)
    
          call.executeAsync().use {
            withContext(Dispatchers.IO) {
              assertThat(it.body.string()).isEqualTo("abc")
            }
          }
        }
      }
    
      @Test
      fun timeoutCall() {
        runTest {
          server.enqueue(
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Jun 20 11:46:46 UTC 2025
    - 5.3K bytes
    - Viewed (0)
  4. okhttp-coroutines/README.md

    OkHttp Coroutines
    =================
    
    Support for Kotlin clients using coroutines.
    
    ```kotlin
    val call = client.newCall(request)
    
    call.executeAsync().use { response ->
      withContext(Dispatchers.IO) {
        println(response.body?.string())
      }
    }
    ```
    
    This is implemented using `suspendCancellableCoroutine`
    but uses the standard Dispatcher in OkHttp. This means
    that by default Kotlin's Dispatchers are not used.
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu Nov 09 15:47:27 UTC 2023
    - 609 bytes
    - Viewed (0)
  5. samples/tlssurvey/src/main/kotlin/okhttp3/survey/Iana.kt

     * limitations under the License.
     */
    package okhttp3.survey
    
    import okhttp3.HttpUrl.Companion.toHttpUrl
    import okhttp3.OkHttpClient
    import okhttp3.Request
    import okhttp3.coroutines.executeAsync
    import okhttp3.survey.types.SuiteId
    import okio.ByteString.Companion.decodeHex
    import okio.IOException
    
    /** Example: "0x00,0x08",TLS_RSA_EXPORT_WITH_DES40_CBC_SHA,Y,N,[RFC4346] */
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 2K bytes
    - Viewed (0)
  6. okhttp-coroutines/api/okhttp-coroutines.api

    public final class okhttp3/coroutines/ExecuteAsyncKt {
    	public static final fun executeAsync (Lokhttp3/Call;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu Apr 18 01:24:38 UTC 2024
    - 163 bytes
    - Viewed (0)
  7. okhttp/src/jvmTest/kotlin/okhttp3/internal/publicsuffix/PublicSuffixListGenerator.kt

    import java.util.TreeSet
    import kotlinx.coroutines.Dispatchers
    import kotlinx.coroutines.withContext
    import okhttp3.HttpUrl.Companion.toHttpUrl
    import okhttp3.OkHttpClient
    import okhttp3.Request
    import okhttp3.coroutines.executeAsync
    import okhttp3.internal.publicsuffix.ResourcePublicSuffixList.Companion.PUBLIC_SUFFIX_RESOURCE
    import okio.BufferedSink
    import okio.ByteString
    import okio.ByteString.Companion.encodeUtf8
    import okio.FileSystem
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Aug 06 05:33:11 UTC 2025
    - 6.1K bytes
    - Viewed (0)
  8. okhttp/src/androidMain/baseline-prof.txt

    HSPLokhttp3/JvmCallExtensionsKt$executeAsync$2$1;-><init>(Lokhttp3/Call;)V
    HSPLokhttp3/JvmCallExtensionsKt$executeAsync$2$2$onResponse$1;-><init>(Lokhttp3/Call;)V
    HSPLokhttp3/JvmCallExtensionsKt$executeAsync$2$2;-><init>(Lkotlinx/coroutines/CancellableContinuation;)V
    HSPLokhttp3/JvmCallExtensionsKt$executeAsync$2$2;->onFailure(Lokhttp3/Call;Ljava/io/IOException;)V
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Dec 30 23:28:56 UTC 2024
    - 127.9K bytes
    - Viewed (0)
  9. CHANGELOG.md

        for a graceful shutdown before it performs an abrupt shutdown.
    
     *  Fix: Honor `RequestBody.isOneShot()` in `MultipartBody`
    
     *  Fix in `okhttp-coroutines`: Don't leak response bodies in `executeAsync()`. We had a bug where
        we didn't call `Response.close()` if the coroutine was canceled before its response was
        returned.
    
     *  Upgrade: [Okio 3.9.0][okio_3_9_0].
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jul 07 19:32:33 UTC 2025
    - 31.6K bytes
    - Viewed (1)
Back to top