Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for We (0.34 sec)

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

          return new RequestBody() {
            @Override public MediaType contentType() {
              return body.contentType();
            }
    
            @Override public long contentLength() {
              return -1; // We don't know the compressed length in advance!
            }
    
            @Override public void writeTo(BufferedSink sink) throws IOException {
              BufferedSink gzipSink = Okio.buffer(new GzipSink(sink));
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat May 25 18:02:55 GMT 2019
    - 3.8K bytes
    - Viewed (0)
  2. samples/unixdomainsockets/src/main/java/okhttp3/unixdomainsockets/ClientAndServer.java

    import okhttp3.Response;
    import okhttp3.mockwebserver.MockResponse;
    import okhttp3.mockwebserver.MockWebServer;
    
    /**
     * Create UNIX domain sockets for MockWebServer and OkHttp and connect 'em together. Note that we
     * cannot do TLS over domain sockets.
     */
    public class ClientAndServer {
      public void run() throws Exception {
        File socketFile = new File("/tmp/ClientAndServer.sock");
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Dec 24 03:46:30 GMT 2018
    - 2.1K bytes
    - Viewed (0)
  3. samples/guide/src/main/java/okhttp3/recipes/Authenticate.java

      public Authenticate() {
        client = new OkHttpClient.Builder()
            .authenticator((route, response) -> {
              if (response.request().header("Authorization") != null) {
                return null; // Give up, we've already attempted to authenticate.
              }
    
              System.out.println("Authenticating for response: " + response);
              System.out.println("Challenges: " + response.challenges());
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Aug 12 07:26:27 GMT 2021
    - 1.9K bytes
    - Viewed (0)
  4. samples/crawler/src/main/java/okhttp3/sample/Crawler.java

            System.out.printf("XXX: %s %s%n", url, e);
          } finally {
            currentThread.setName(originalName);
          }
        }
      }
    
      public void fetch(HttpUrl url) throws IOException {
        // Skip hosts that we've visited many times.
        AtomicInteger hostnameCount = new AtomicInteger();
        AtomicInteger previous = hostnames.putIfAbsent(url.host(), hostnameCount);
        if (previous != null) hostnameCount = previous;
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Aug 12 07:26:27 GMT 2021
    - 4.6K bytes
    - Viewed (0)
  5. samples/guide/src/main/java/okhttp3/recipes/PrintEventsNonConcurrent.java

    import okhttp3.OkHttpClient;
    import okhttp3.Protocol;
    import okhttp3.Request;
    import okhttp3.Response;
    
    /**
     * This prints events for a single in-flight call. It won't work for multiple concurrent calls
     * because we don't know what callStartNanos refers to.
     */
    public final class PrintEventsNonConcurrent {
      private final OkHttpClient client = new OkHttpClient.Builder()
          .eventListener(new PrintingEventListener())
          .build();
    
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun Feb 16 23:20:49 GMT 2020
    - 5.3K bytes
    - Viewed (0)
Back to top