Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for callOkHttp (0.12 sec)

  1. module-tests/src/test/java/okhttp3/modules/test/JavaModuleTest.java

    import static org.junit.jupiter.api.Assertions.assertTrue;
    
    class JavaModuleTest {
      @Test
      public void testVisibility() {
        // Just check we can run code that depends on OkHttp types
        OkHttpCaller.callOkHttp(HttpUrl.get("https://square.com/robots.txt"));
      }
    
      @Test
      public void testMockWebServer() throws IOException {
        MockWebServer server = new MockWebServer();
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Sun Sep 21 06:22:22 UTC 2025
    - 2.1K bytes
    - Viewed (0)
  2. module-tests/src/main/java/okhttp3/modules/OkHttpCaller.java

    import okhttp3.Request;
    import okhttp3.logging.HttpLoggingInterceptor;
    import okhttp3.logging.LoggingEventListener;
    
    /**
     * Just checking compilation works
     */
    public class OkHttpCaller {
      public static Call callOkHttp(HttpUrl url) {
        OkHttpClient client = new OkHttpClient
          .Builder()
          .eventListenerFactory(new LoggingEventListener.Factory(HttpLoggingInterceptor.Logger.DEFAULT))
          .build();
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Sun Sep 21 06:22:22 UTC 2025
    - 1.2K bytes
    - Viewed (0)
  3. module-tests/src/main/java/okhttp3/modules/Main.java

    package okhttp3.modules;
    
    import okhttp3.Call;
    import okhttp3.HttpUrl;
    
    import java.io.IOException;
    
    public class Main {
      public static void main(String[] args) throws IOException {
        Call call = OkHttpCaller.callOkHttp(HttpUrl.get("https://square.com/robots.txt"));
    
        System.out.println(call.execute().body().string());
      }
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Sun Sep 21 06:22:22 UTC 2025
    - 934 bytes
    - Viewed (0)
Back to top