Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for internet (0.21 sec)

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

            .build();
    
        Response response = client.newCall(request).execute();
        response.body().close();
      }
    
      private static class LoggingInterceptor implements Interceptor {
        @Override public Response intercept(Chain chain) throws IOException {
          long t1 = System.nanoTime();
          Request request = chain.request();
          logger.info(String.format("Sending request %s on %s%n%s",
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Jan 01 15:55:32 GMT 2016
    - 2K bytes
    - Viewed (0)
  2. samples/guide/src/main/java/okhttp3/recipes/PreemptiveAuth.java

        BasicAuthInterceptor(String host, String username, String password) {
          this.credentials = Credentials.basic(username, password);
          this.host = host;
        }
    
        @Override public Response intercept(Chain chain) throws IOException {
          Request request = chain.request();
          if (request.url().host().equals(host)) {
            request = request.newBuilder()
                .header("Authorization", credentials)
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Nov 05 07:46:46 GMT 2018
    - 2.1K bytes
    - Viewed (0)
  3. samples/guide/src/main/java/okhttp3/recipes/CheckHandshake.java

        final Set<String> denylist = Collections.singleton(
            "sha256/afwiKY3RxoMmLkuRW1l7QsPZTJPwDS2pdDROQjXw8ig=");
    
        @Override public Response intercept(Chain chain) throws IOException {
          for (Certificate certificate : chain.connection().handshake().peerCertificates()) {
            String pin = CertificatePinner.pin(certificate);
            if (denylist.contains(pin)) {
    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)
  4. samples/guide/src/main/java/okhttp3/recipes/RequestBodyCompression.java

      }
    
      /** This interceptor compresses the HTTP request body. Many webservers can't handle this! */
      static class GzipRequestInterceptor implements Interceptor {
        @Override public Response intercept(Chain chain) throws IOException {
          Request originalRequest = chain.request();
          if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) {
            return chain.proceed(originalRequest);
    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)
  5. samples/guide/src/main/java/okhttp3/recipes/CurrentDateHeader.java

          System.out.println(response.request().header("Date"));
        }
      }
    
      static class CurrentDateInterceptor implements Interceptor {
        @Override public Response intercept(Chain chain) throws IOException {
          Request request = chain.request();
          Headers newHeaders = request.headers()
              .newBuilder()
              .add("Date", new Date())
              .build();
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Oct 31 15:32:50 GMT 2018
    - 1.8K bytes
    - Viewed (0)
Back to top