Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 33 for com (0.11 sec)

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

        client = new OkHttpClient.Builder()
            .addInterceptor(
                new BasicAuthInterceptor("publicobject.com", "jesse", "password1"))
            .build();
      }
    
      public void run() throws Exception {
        Request request = new Request.Builder()
            .url("https://publicobject.com/secrets/hellosecret.txt")
            .build();
    
        try (Response response = client.newCall(request).execute()) {
    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)
  2. samples/guide/src/main/java/okhttp3/recipes/SynchronousGet.java

    public final class SynchronousGet {
      private final OkHttpClient client = new OkHttpClient();
    
      public void run() throws Exception {
        Request request = new Request.Builder()
            .url("https://publicobject.com/helloworld.txt")
            .build();
    
        try (Response response = client.newCall(request).execute()) {
          if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
    
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun May 22 01:29:42 GMT 2016
    - 1.5K bytes
    - Viewed (0)
  3. samples/guide/src/main/java/okhttp3/recipes/LoggingInterceptors.java

          .addInterceptor(new LoggingInterceptor())
          .build();
    
      public void run() throws Exception {
        Request request = new Request.Builder()
            .url("https://publicobject.com/helloworld.txt")
            .build();
    
        Response response = client.newCall(request).execute();
        response.body().close();
      }
    
      private static class LoggingInterceptor implements Interceptor {
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Jan 01 15:55:32 GMT 2016
    - 2K bytes
    - Viewed (0)
  4. samples/guide/src/main/java/okhttp3/guide/PostExample.java

      }
    
      public static void main(String[] args) throws IOException {
        PostExample example = new PostExample();
        String json = example.bowlingJson("Jesse", "Jake");
        String response = example.post("http://www.roundsapp.com/post", json);
        System.out.println(response);
      }
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Apr 05 03:30:42 GMT 2024
    - 2K bytes
    - Viewed (0)
  5. samples/guide/src/main/java/okhttp3/recipes/CustomCipherSuites.java

          return socket;
        }
      }
    
      public void run() throws Exception {
        Request request = new Request.Builder()
            .url("https://publicobject.com/helloworld.txt")
            .build();
    
        try (Response response = client.newCall(request).execute()) {
          if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
    
    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/guide/src/main/java/okhttp3/recipes/CacheResponse.java

        client = new OkHttpClient.Builder()
            .cache(cache)
            .build();
      }
    
      public void run() throws Exception {
        Request request = new Request.Builder()
            .url("http://publicobject.com/helloworld.txt")
            .build();
    
        String response1Body;
        try (Response response1 = client.newCall(request).execute()) {
          if (!response1.isSuccessful()) throw new IOException("Unexpected code " + response1);
    
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun May 22 01:29:42 GMT 2016
    - 2.4K bytes
    - Viewed (0)
  7. samples/slack/src/main/java/okhttp3/slack/OAuthSessionFactory.java

        }
    
        synchronized (this) {
          listeners.remove(state);
        }
    
        // Success!
        return new MockResponse()
            .setResponseCode(302)
            .addHeader("Location", "https://twitter.com/CuteEmergency/status/789457462864863232");
      }
    
      public interface Listener {
        void sessionGranted(OAuthSession session);
      }
    
      @Override public void close() {
    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)
  8. samples/guide/src/main/java/okhttp3/recipes/PrintEventsNonConcurrent.java

          .eventListener(new PrintingEventListener())
          .build();
    
      public void run() throws Exception {
        Request request = new Request.Builder()
            .url("https://publicobject.com/helloworld.txt")
            .build();
    
        System.out.println("REQUEST 1 (new connection)");
        try (Response response = client.newCall(request).execute()) {
          // Consume and discard the response body.
    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. regression-test/src/androidTest/java/okhttp/regression/LetsEncryptTest.java

        }
    
        OkHttpClient client = builder.build();
    
        sendRequest(client, "https://valid-isrgrootx1.letsencrypt.org/robots.txt");
    
        try {
          sendRequest(client, "https://google.com/robots.txt");
          if (androidMorEarlier) {
            // will pass with default CAs on N or later
            fail();
          }
        } catch (SSLHandshakeException sslhe) {
          assertTrue(androidMorEarlier);
        }
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Nov 17 07:40:31 GMT 2020
    - 6.1K bytes
    - Viewed (0)
  10. samples/guide/src/main/java/okhttp3/recipes/RequestBodyCompression.java

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    package okhttp3.recipes;
    
    import com.squareup.moshi.JsonAdapter;
    import com.squareup.moshi.Moshi;
    import com.squareup.moshi.Types;
    import java.io.IOException;
    import java.util.LinkedHashMap;
    import java.util.Map;
    import okhttp3.Interceptor;
    import okhttp3.MediaType;
    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)
Back to top