Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 101 for void (0.12 sec)

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

    import okhttp3.Response;
    
    public class CancelCall {
      private final ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
      private final OkHttpClient client = new OkHttpClient();
    
      public void run() throws Exception {
        Request request = new Request.Builder()
            .url("http://httpbin.org/delay/2") // This URL is served with a 2 second delay.
            .build();
    
        final long startNanos = System.nanoTime();
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 12 03:31:36 GMT 2019
    - 2.1K bytes
    - Viewed (0)
  2. samples/slack/src/main/java/okhttp3/slack/RtmSession.java

      @Override public synchronized void onOpen(WebSocket webSocket, Response response) {
        System.out.println("onOpen: " + response);
      }
    
      // TOOD(jwilson): decode incoming messages and dispatch them somewhere.
      @Override public void onMessage(WebSocket webSocket, String text) {
        System.out.println("onMessage: " + text);
      }
    
      @Override public void onClosing(WebSocket webSocket, int code, String reason) {
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Nov 19 20:16:58 GMT 2016
    - 2.4K bytes
    - Viewed (0)
  3. samples/guide/src/main/java/okhttp3/recipes/PostStreamingWithPipe.java

          System.out.println(response.body().string());
        }
      }
    
      private void streamPrimesToSinkAsynchronously(final BufferedSink sink) {
        Thread thread = new Thread("writer") {
          @Override public void run() {
            try {
              sink.writeUtf8("Numbers\n");
              sink.writeUtf8("-------\n");
              for (int i = 2; i <= 997; i++) {
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Jul 06 03:18:15 GMT 2018
    - 3.1K bytes
    - Viewed (0)
  4. samples/guide/src/main/java/okhttp3/recipes/Progress.java

    import okio.Okio;
    import okio.Source;
    
    public final class Progress {
    
      public void run() throws Exception {
        Request request = new Request.Builder()
            .url("https://publicobject.com/helloworld.txt")
            .build();
    
        final ProgressListener progressListener = new ProgressListener() {
          boolean firstUpdate = true;
    
          @Override public void update(long bytesRead, long contentLength, boolean done) {
            if (done) {
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 12 03:31:36 GMT 2019
    - 3.9K bytes
    - Viewed (0)
  5. okhttp/src/main/kotlin/okhttp3/internal/-UtilCommon.kt

      for (i in 0 until length) {
        val c = this[i]
        if (c <= '\u001f' || c >= '\u007f') {
          return i
        }
      }
      return -1
    }
    
    /** Returns true if we should void putting this this header in an exception or toString(). */
    internal fun isSensitiveHeader(name: String): Boolean {
      return name.equals("Authorization", ignoreCase = true) ||
        name.equals("Cookie", ignoreCase = true) ||
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11K bytes
    - Viewed (0)
  6. samples/guide/src/main/java/okhttp3/recipes/RequestBodyCompression.java

      private final Moshi moshi = new Moshi.Builder().build();
      private final JsonAdapter<Map<String, String>> mapJsonAdapter = moshi.adapter(
          Types.newParameterizedType(Map.class, String.class, String.class));
    
      public void run() throws Exception {
        Map<String, String> requestBody = new LinkedHashMap<>();
        requestBody.put("longUrl", "https://publicobject.com/2014/12/04/html-formatting-javadocs/");
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat May 25 18:02:55 GMT 2019
    - 3.8K bytes
    - Viewed (0)
  7. mockwebserver-junit5/README.md

    ```
    class MyTest {
      @Test
      void test(MockWebServer server) {
        ...
      }
    }
    ```
    
    Alternately you may add the [MockWebServer] as a constructor parameter:
    
    ```
    class MyTest {
      private final MockWebServer server;
    
      MyTest(MockWebServer server) {
        this.server = server;
      }
    
      @Test
      void test() {
        ...
      }
    }
    ```
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Jan 14 10:20:09 GMT 2024
    - 1.3K bytes
    - Viewed (0)
  8. samples/guide/src/main/java/okhttp3/recipes/CheckHandshake.java

          return chain.proceed(chain.request());
        }
      };
    
      private final OkHttpClient client = new OkHttpClient.Builder()
          .addNetworkInterceptor(CHECK_HANDSHAKE_INTERCEPTOR)
          .build();
    
      public void run() throws Exception {
        Request request = new Request.Builder()
            .url("https://publicobject.com/helloworld.txt")
            .build();
    
        try (Response response = client.newCall(request).execute()) {
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 15 14:55:09 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  9. samples/guide/src/main/java/okhttp3/recipes/PerCallSettings.java

    import java.util.concurrent.TimeUnit;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    
    public final class PerCallSettings {
      private final OkHttpClient client = new OkHttpClient();
    
      public void run() throws Exception {
        Request request = new Request.Builder()
            .url("http://httpbin.org/delay/1") // This URL is served with a 1 second delay.
            .build();
    
        // Copy to customize OkHttp for this request.
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun May 22 01:29:42 GMT 2016
    - 1.9K bytes
    - Viewed (0)
  10. samples/guide/src/main/java/okhttp3/recipes/RewriteResponseCacheControl.java

        Cache cache = new Cache(cacheDirectory, 1024 * 1024);
        cache.evictAll();
    
        client = new OkHttpClient.Builder()
            .cache(cache)
            .build();
      }
    
      public void run() throws Exception {
        for (int i = 0; i < 5; i++) {
          System.out.println("    Request: " + i);
    
          Request request = new Request.Builder()
              .url("https://api.github.com/search/repositories?q=http")
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 12 03:31:36 GMT 2019
    - 2.6K bytes
    - Viewed (0)
Back to top