Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 162 for okHttpClient (0.16 sec)

  1. samples/guide/src/main/java/okhttp3/recipes/WebSocketEcho.java

    package okhttp3.recipes;
    
    import java.util.concurrent.TimeUnit;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    import okhttp3.WebSocket;
    import okhttp3.WebSocketListener;
    import okio.ByteString;
    
    public final class WebSocketEcho extends WebSocketListener {
      private void run() {
        OkHttpClient client = new OkHttpClient.Builder()
            .readTimeout(0,  TimeUnit.MILLISECONDS)
            .build();
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu Apr 04 11:40:21 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  2. okhttp-zstd/src/test/java/okhttp3/zstd/ZstdTestMain.kt

     * limitations under the License.
     */
    package okhttp3.zstd
    
    import okhttp3.CompressionInterceptor
    import okhttp3.OkHttpClient
    import okhttp3.Request
    
    fun main() {
      val client =
        OkHttpClient
          .Builder()
          .addInterceptor(CompressionInterceptor(Zstd))
          .build()
    
      sendRequest("https://developers.facebook.com/docs/", client)
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Tue Jul 29 20:01:04 UTC 2025
    - 1.3K bytes
    - Viewed (0)
  3. regression-test/src/androidTest/java/okhttp/regression/compare/OkHttpClientTest.java

     * https://square.github.io/okhttp/
     */
    @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());
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Nov 14 17:38:22 UTC 2020
    - 1.4K bytes
    - Viewed (0)
  4. samples/guide/src/main/java/okhttp3/recipes/PostFile.java

    import java.io.IOException;
    import okhttp3.MediaType;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.RequestBody;
    import okhttp3.Response;
    
    public final class PostFile {
      public static final MediaType MEDIA_TYPE_MARKDOWN
          = MediaType.get("text/x-markdown; charset=utf-8");
    
      private final OkHttpClient client = new OkHttpClient();
    
      public void run() throws Exception {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat May 25 18:02:55 UTC 2019
    - 1.5K bytes
    - Viewed (0)
  5. android-test/src/androidTest/java/okhttp/android/test/StrictModeTest.kt

        applyStrictMode()
    
        // Not currently safe
        // See https://github.com/square/okhttp/pull/8248
        OkHttpClient()
    
        assertThat(violations).hasSize(1)
        assertThat(violations[0].message).isEqualTo("newSSLContext")
      }
    
      @Test
      fun testNewCall() {
        Platform.resetForTests()
    
        val client = OkHttpClient()
    
        applyStrictMode()
    
        // Safe on main
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu May 22 14:39:30 UTC 2025
    - 2.1K bytes
    - Viewed (0)
  6. samples/guide/src/main/java/okhttp3/recipes/LoggingInterceptors.java

    import java.io.IOException;
    import java.util.logging.Logger;
    import okhttp3.Interceptor;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    
    public final class LoggingInterceptors {
      private static final Logger logger = Logger.getLogger(LoggingInterceptors.class.getName());
      private final OkHttpClient client = new OkHttpClient.Builder()
          .addInterceptor(new LoggingInterceptor())
          .build();
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Jan 01 15:55:32 UTC 2016
    - 2K bytes
    - Viewed (0)
  7. okhttp-dnsoverhttps/src/test/java/okhttp3/dnsoverhttps/DohProviders.kt

    import java.net.UnknownHostException
    import okhttp3.HttpUrl.Companion.toHttpUrl
    import okhttp3.OkHttpClient
    
    /**
     * Temporary registry of known DNS over HTTPS providers.
     *
     * https://github.com/curl/curl/wiki/DNS-over-HTTPS
     */
    object DohProviders {
      private fun buildGoogle(bootstrapClient: OkHttpClient): DnsOverHttps =
        DnsOverHttps
          .Builder()
          .client(bootstrapClient)
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 3.8K bytes
    - Viewed (0)
  8. samples/guide/src/main/java/okhttp3/recipes/kt/ConfigureTimeouts.kt

     * limitations under the License.
     */
    package okhttp3.recipes.kt
    
    import java.util.concurrent.TimeUnit
    import okhttp3.OkHttpClient
    import okhttp3.Request
    
    class ConfigureTimeouts {
      private val client: OkHttpClient =
        OkHttpClient
          .Builder()
          .connectTimeout(5, TimeUnit.SECONDS)
          .writeTimeout(5, TimeUnit.SECONDS)
          .readTimeout(5, TimeUnit.SECONDS)
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 1.3K bytes
    - Viewed (0)
  9. samples/guide/src/main/java/okhttp3/recipes/CurrentDateHeader.java

    package okhttp3.recipes;
    
    import java.io.IOException;
    import java.util.Date;
    import okhttp3.Headers;
    import okhttp3.Interceptor;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    
    public final class CurrentDateHeader {
      private final OkHttpClient client = new OkHttpClient.Builder()
          .addInterceptor(new CurrentDateInterceptor())
          .build();
    
      public void run() throws Exception {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Oct 31 15:32:50 UTC 2018
    - 1.8K bytes
    - Viewed (0)
  10. samples/guide/src/main/java/okhttp3/recipes/PostString.java

    import java.io.IOException;
    import okhttp3.MediaType;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.RequestBody;
    import okhttp3.Response;
    
    public final class PostString {
      public static final MediaType MEDIA_TYPE_MARKDOWN
          = MediaType.get("text/x-markdown; charset=utf-8");
    
      private final OkHttpClient client = new OkHttpClient();
    
      public void run() throws Exception {
        String postBody = ""
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat May 25 18:02:55 UTC 2019
    - 1.7K bytes
    - Viewed (0)
Back to top