Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 38 for OkHttpClient (0.19 sec)

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

    package okhttp3.recipes;
    
    import java.io.IOException;
    import java.security.cert.Certificate;
    import okhttp3.CertificatePinner;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    
    public final class CertificatePinning {
      private final OkHttpClient client = new OkHttpClient.Builder()
          .certificatePinner(
              new CertificatePinner.Builder()
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Dec 08 21:30:01 GMT 2019
    - 1.7K bytes
    - Viewed (0)
  2. samples/unixdomainsockets/src/main/java/okhttp3/unixdomainsockets/ClientAndServer.java

        server.setProtocols(Collections.singletonList(Protocol.H2_PRIOR_KNOWLEDGE));
        server.enqueue(new MockResponse().setBody("hello"));
        server.start();
    
        OkHttpClient client = new OkHttpClient.Builder()
            .socketFactory(new UnixDomainSocketFactory(socketFile))
            .protocols(Collections.singletonList(Protocol.H2_PRIOR_KNOWLEDGE))
            .build();
    
    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. regression-test/src/androidTest/java/okhttp/regression/LetsEncryptTest.java

     * for background.
     */
    @RunWith(AndroidJUnit4.class)
    public class LetsEncryptTest {
      @Test public void getFailsWithoutAdditionalCert() throws IOException {
        OkHttpClient client = new OkHttpClient();
    
        boolean androidMorEarlier = Build.VERSION.SDK_INT <= 23;
        try {
          sendRequest(client, "https://valid-isrgrootx1.letsencrypt.org/robots.txt");
          if (androidMorEarlier) {
            fail();
    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)
  4. samples/crawler/src/main/java/okhttp3/sample/Crawler.java

    import okhttp3.HttpUrl;
    import okhttp3.MediaType;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    import org.jsoup.Jsoup;
    import org.jsoup.nodes.Document;
    import org.jsoup.nodes.Element;
    
    /**
     * Fetches HTML from a requested URL, follows the links, and repeats.
     */
    public final class Crawler {
      private final OkHttpClient client;
    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)
  5. samples/guide/src/main/java/okhttp3/recipes/WebSocketEcho.java

    package okhttp3.recipes;
    
    import java.util.concurrent.TimeUnit;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    import okhttp3.WebSocket;
    import okhttp3.WebSocketListener;
    import okio.ByteString;
    
    public final class WebSocketEcho extends WebSocketListener {
      private void run() {
        OkHttpClient client = new OkHttpClient.Builder()
            .readTimeout(0,  TimeUnit.MILLISECONDS)
            .build();
    
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 04 11:40:21 GMT 2024
    - 1.6K bytes
    - Viewed (0)
  6. samples/guide/src/main/java/okhttp3/recipes/CustomTrust.java

     * limitations under the License.
     */
    package okhttp3.recipes;
    
    import java.io.IOException;
    import java.security.cert.X509Certificate;
    import okhttp3.Headers;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    import okhttp3.tls.Certificates;
    import okhttp3.tls.HandshakeCertificates;
    
    public final class CustomTrust {
    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)
  7. samples/guide/src/main/java/okhttp3/recipes/PreemptiveAuth.java

    import java.io.IOException;
    import okhttp3.Credentials;
    import okhttp3.Interceptor;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    
    public final class PreemptiveAuth {
      private final OkHttpClient client;
    
      public PreemptiveAuth() {
        client = new OkHttpClient.Builder()
            .addInterceptor(
                new BasicAuthInterceptor("publicobject.com", "jesse", "password1"))
    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)
  8. samples/guide/src/main/java/okhttp3/recipes/CacheResponse.java

    import okhttp3.Cache;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    
    public final class CacheResponse {
      private final OkHttpClient client;
    
      public CacheResponse(File cacheDirectory) throws Exception {
        int cacheSize = 10 * 1024 * 1024; // 10 MiB
        Cache cache = new Cache(cacheDirectory, cacheSize);
    
        client = new OkHttpClient.Builder()
            .cache(cache)
            .build();
    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)
  9. samples/guide/src/main/java/okhttp3/recipes/CancelCall.java

    import java.util.concurrent.TimeUnit;
    import okhttp3.Call;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    
    public class CancelCall {
      private final ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
      private final OkHttpClient client = new OkHttpClient();
    
      public void run() throws Exception {
        Request request = new Request.Builder()
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 12 03:31:36 GMT 2019
    - 2.1K bytes
    - Viewed (0)
  10. samples/guide/src/main/java/okhttp3/recipes/SynchronousGet.java

     * limitations under the License.
     */
    package okhttp3.recipes;
    
    import java.io.IOException;
    import okhttp3.Headers;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    
    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")
    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)
Back to top