Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for Ehat (0.33 sec)

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

    import okhttp3.mockwebserver.MockResponse;
    import okhttp3.mockwebserver.MockWebServer;
    import okhttp3.tls.HandshakeCertificates;
    import okhttp3.tls.HeldCertificate;
    
    /**
     * Create an HTTPS server with a self-signed certificate that OkHttp trusts.
     */
    public class HttpsServer {
      public void run() throws Exception {
        HeldCertificate localhostCertificate = new HeldCertificate.Builder()
            .addSubjectAlternativeName("localhost")
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 02 14:04:37 GMT 2023
    - 2.1K 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 May 03 11:42:14 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/CustomTrust.java

      private final OkHttpClient client;
    
      public CustomTrust() {
        // This implementation just embeds the PEM files in Java strings; most applications will
        // instead read this from a resource file that gets bundled with the application.
    
        HandshakeCertificates certificates = new HandshakeCertificates.Builder()
            .addTrustedCertificate(letsEncryptCertificateAuthority)
    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)
  4. samples/slack/src/main/java/okhttp3/slack/SlackClient.java

        int port = 53203;
        SlackApi slackApi = new SlackApi(clientId, clientSecret, port);
    
        SlackClient client = new SlackClient(slackApi);
        String scopes = "channels:history channels:read channels:write chat:write:bot chat:write:user "
            + "dnd:read dnd:write emoji:read files:read files:write:user groups:history groups:read "
            + "groups:write im:history im:read im:write mpim:history mpim:read mpim:write pins:read "
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 12 03:31:36 GMT 2019
    - 3.4K bytes
    - Viewed (0)
  5. samples/guide/src/main/java/okhttp3/recipes/CustomCipherSuites.java

        SSLContext sslContext = SSLContext.getInstance("TLS");
        sslContext.init(null, new TrustManager[] { trustManager }, null);
    
        return sslContext.getSocketFactory();
      }
    
      /** Returns a trust manager that trusts the VM's default certificate authorities. */
      private X509TrustManager defaultTrustManager() throws GeneralSecurityException {
        TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Mar 14 21:57:42 GMT 2019
    - 6.5K bytes
    - Viewed (0)
  6. samples/slack/src/main/java/okhttp3/slack/OAuthSessionFactory.java

    import okio.ByteString;
    
    /**
     * Runs a MockWebServer on localhost and uses it as the backend to receive an OAuth session.
     *
     * <p>Clients should call {@link #start}, {@link #newAuthorizeUrl} and {@link #close} in that order.
     * Clients may request multiple sessions.
     */
    public final class OAuthSessionFactory extends Dispatcher implements Closeable {
      private final SecureRandom secureRandom = new SecureRandom();
    
    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)
  7. 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 May 03 11:42:14 GMT 2024
    - Last Modified: Thu Aug 12 07:26:27 GMT 2021
    - 4.6K bytes
    - Viewed (0)
  8. samples/guide/src/main/java/okhttp3/recipes/PrintEventsNonConcurrent.java

    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 May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 16 23:20:49 GMT 2020
    - 5.3K bytes
    - Viewed (0)
  9. samples/guide/src/main/java/okhttp3/recipes/RewriteResponseCacheControl.java

    import okhttp3.Cache;
    import okhttp3.Interceptor;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    
    public final class RewriteResponseCacheControl {
      /** Dangerous interceptor that rewrites the server's cache-control header. */
      private static final Interceptor REWRITE_CACHE_CONTROL_INTERCEPTOR = chain -> {
        Response originalResponse = chain.proceed(chain.request());
        return originalResponse.newBuilder()
    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