Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for if (0.38 sec)

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

            .addTrustedCertificate(letsEncryptCertificateAuthority)
            .addTrustedCertificate(entrustRootCertificateAuthority)
            .addTrustedCertificate(comodoRsaCertificationAuthority)
            // Uncomment if standard certificates are also required.
            //.addPlatformTrustedCertificates()
            .build();
    
        client = new OkHttpClient.Builder()
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Aug 12 07:26:27 GMT 2021
    - 9.3K bytes
    - Viewed (2)
  2. samples/crawler/src/main/java/okhttp3/sample/Crawler.java

        // Skip hosts that we've visited many times.
        AtomicInteger hostnameCount = new AtomicInteger();
        AtomicInteger previous = hostnames.putIfAbsent(url.host(), hostnameCount);
        if (previous != null) hostnameCount = previous;
        if (hostnameCount.incrementAndGet() > 100) return;
    
        Request request = new Request.Builder()
            .url(url)
            .build();
        try (Response response = client.newCall(request).execute()) {
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Aug 12 07:26:27 GMT 2021
    - 4.6K bytes
    - Viewed (0)
  3. samples/slack/src/main/java/okhttp3/slack/OAuthSessionFactory.java

        this.slackApi = slackApi;
      }
    
      public void start() throws Exception {
        if (mockWebServer != null) throw new IllegalStateException();
    
        mockWebServer = new MockWebServer();
        mockWebServer.setDispatcher(this);
        mockWebServer.start(slackApi.port);
      }
    
      public HttpUrl newAuthorizeUrl(String scopes, String team, Listener listener) {
        if (mockWebServer == null) throw new IllegalStateException();
    
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Aug 12 07:26:27 GMT 2021
    - 3.8K bytes
    - Viewed (0)
  4. samples/guide/src/main/java/okhttp3/recipes/CheckHandshake.java

        @Override public Response intercept(Chain chain) throws IOException {
          for (Certificate certificate : chain.connection().handshake().peerCertificates()) {
            String pin = CertificatePinner.pin(certificate);
            if (denylist.contains(pin)) {
              throw new IOException("Denylisted peer certificate: " + pin);
            }
          }
          return chain.proceed(chain.request());
        }
      };
    
    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)
  5. samples/guide/src/main/java/okhttp3/recipes/Authenticate.java

    import okhttp3.Response;
    
    public final class Authenticate {
      private final OkHttpClient client;
    
      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);
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Aug 12 07:26:27 GMT 2021
    - 1.9K bytes
    - Viewed (0)
Back to top