Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 111 for OkHttpClient (0.23 sec)

  1. README.md

    supports both synchronous blocking calls and async calls with callbacks.
    
    
    Get a URL
    ---------
    
    This program downloads a URL and prints its contents as a string. [Full source][get_example].
    
    ```java
    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()) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Dec 20 23:27:07 GMT 2023
    - 6.2K bytes
    - Viewed (0)
  2. samples/guide/src/main/java/okhttp3/recipes/kt/DevServer.kt

     * limitations under the License.
     */
    package okhttp3.recipes.kt
    
    import java.io.IOException
    import java.net.HttpURLConnection.HTTP_MOVED_TEMP
    import okhttp3.OkHttpClient
    import okhttp3.Request
    import okhttp3.mockwebserver.MockResponse
    import okhttp3.mockwebserver.MockWebServer
    import okhttp3.tls.HandshakeCertificates
    import okhttp3.tls.internal.TlsUtil
    
    class DevServer {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  3. android-test/src/androidTest/java/okhttp/android/test/sni/SniOverrideTest.kt

    import okhttp3.Dns
    import okhttp3.OkHttpClient
    import okhttp3.Protocol
    import okhttp3.Request
    import org.junit.jupiter.api.Assumptions.assumeTrue
    import org.junit.jupiter.api.Tag
    import org.junit.jupiter.api.Test
    
    /**
     * Tests for SNI overriding on Android.
     */
    @Tag("Remote")
    class SniOverrideTest {
      var client =
        OkHttpClient.Builder()
          .build()
    
      @Test
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.6K bytes
    - Viewed (0)
  4. samples/guide/src/main/java/okhttp3/recipes/kt/PostStreaming.kt

    import java.io.IOException
    import okhttp3.HttpUrl.Companion.toHttpUrl
    import okhttp3.MediaType.Companion.toMediaType
    import okhttp3.OkHttpClient
    import okhttp3.Request
    import okhttp3.RequestBody
    import okio.BufferedSink
    
    class PostStreaming {
      private val client = OkHttpClient()
    
      fun run() {
        val requestBody =
          object : RequestBody() {
            override fun contentType() = MEDIA_TYPE_MARKDOWN
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  5. samples/guide/src/main/java/okhttp3/recipes/kt/CustomTrust.kt

     * limitations under the License.
     */
    package okhttp3.recipes.kt
    
    import java.io.IOException
    import java.security.cert.X509Certificate
    import okhttp3.OkHttpClient
    import okhttp3.Request.Builder
    import okhttp3.tls.HandshakeCertificates
    import okhttp3.tls.decodeCertificatePem
    
    class CustomTrust {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 8.8K bytes
    - Viewed (5)
  6. okhttp-urlconnection/src/main/kotlin/okhttp3/JavaNetAuthenticator.kt

    package okhttp3
    
    import java.io.IOException
    import okhttp3.Authenticator.Companion.JAVA_NET_AUTHENTICATOR
    
    /**
     * Do not use this.
     *
     * Instead, configure your OkHttpClient.Builder to use `Authenticator.JAVA_NET_AUTHENTICATOR`:
     *
     * ```
     *   val okHttpClient = OkHttpClient.Builder()
     *     .authenticator(okhttp3.Authenticator.Companion.JAVA_NET_AUTHENTICATOR)
     *     .build()
     * ```
     */
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.3K bytes
    - Viewed (0)
  7. android-test/src/androidTest/java/okhttp/android/test/alpn/AlpnOverrideTest.kt

    import javax.net.ssl.SSLSocketFactory
    import okhttp3.Call
    import okhttp3.Connection
    import okhttp3.ConnectionSpec
    import okhttp3.DelegatingSSLSocketFactory
    import okhttp3.EventListener
    import okhttp3.OkHttpClient
    import okhttp3.Request
    import org.junit.jupiter.api.Tag
    import org.junit.jupiter.api.Test
    
    /**
     * Tests for ALPN overriding on Android.
     */
    @Tag("Remote")
    class AlpnOverrideTest {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/internal/authenticator/JavaNetAuthenticator.kt

    import okhttp3.Request
    import okhttp3.Response
    import okhttp3.Route
    
    /**
     * Adapts [Authenticator] to [okhttp3.Authenticator]. Configure OkHttp to use [Authenticator] with
     * [okhttp3.OkHttpClient.Builder.authenticator] or [okhttp3.OkHttpClient.Builder.proxyAuthenticator].
     */
    class JavaNetAuthenticator(private val defaultDns: Dns = Dns.SYSTEM) : okhttp3.Authenticator {
      @Throws(IOException::class)
      override fun authenticate(
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.2K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/internal/platform/android/StandardAndroidSocketAdapter.kt

     * limitations under the License.
     */
    package okhttp3.internal.platform.android
    
    import javax.net.ssl.SSLSocket
    import javax.net.ssl.SSLSocketFactory
    import javax.net.ssl.X509TrustManager
    import okhttp3.OkHttpClient
    import okhttp3.internal.platform.Platform
    import okhttp3.internal.readFieldOrNull
    
    /**
     * Base Android reflection based SocketAdapter for the built in Android SSLSocket.
     *
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  10. samples/guide/src/main/java/okhttp3/recipes/kt/YubikeyClientAuth.kt

    import javax.security.auth.callback.Callback
    import javax.security.auth.callback.CallbackHandler
    import javax.security.auth.callback.PasswordCallback
    import javax.security.auth.callback.UnsupportedCallbackException
    import okhttp3.OkHttpClient
    import okhttp3.Request
    import okhttp3.internal.SuppressSignatureCheck
    import okhttp3.internal.platform.Platform
    
    /**
     * Example of using a hardware key to perform client auth.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.2K bytes
    - Viewed (1)
Back to top