Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 42 for url (0.16 sec)

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

          logger.info(String.format("Sending request %s on %s%n%s",
              request.url(), chain.connection(), request.headers()));
          Response response = chain.proceed(request);
    
          long t2 = System.nanoTime();
          logger.info(String.format("Received response for %s in %.1fms%n%s",
              request.url(), (t2 - t1) / 1e6d, response.headers()));
          return response;
        }
      }
    
    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/CustomTrust.java

                .sslSocketFactory(certificates.sslSocketFactory(), certificates.trustManager())
                .build();
      }
    
      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()) {
            Headers responseHeaders = response.headers();
    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)
  3. samples/crawler/src/main/java/okhttp3/sample/Crawler.java

      }
    
      private void drainQueue() throws Exception {
        for (HttpUrl url; (url = queue.take()) != null; ) {
          if (!fetchedUrls.add(url)) {
            continue;
          }
    
          Thread currentThread = Thread.currentThread();
          String originalName = currentThread.getName();
          currentThread.setName("Crawler " + url);
          try {
            fetch(url);
          } catch (IOException e) {
    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)
  4. samples/guide/src/main/java/okhttp3/guide/PostExample.java

      final OkHttpClient client = new OkHttpClient();
    
      String post(String url, String json) throws IOException {
        RequestBody body = RequestBody.create(json, JSON);
        Request request = new Request.Builder()
            .url(url)
            .post(body)
            .build();
        try (Response response = client.newCall(request).execute()) {
          return response.body().string();
    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/slack/src/main/java/okhttp3/slack/SlackClient.java

      private OAuthSessionFactory sessionFactory;
    
      /** Guarded by this. */
      private OAuthSession session;
    
      public SlackClient(SlackApi slackApi) {
        this.slackApi = slackApi;
      }
    
      /** Shows a browser URL to authorize this app to act as this user. */
      public void requestOauthSession(String scopes, String team) throws Exception {
        if (sessionFactory == null) {
          sessionFactory = new OAuthSessionFactory(slackApi);
    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)
  6. samples/slack/src/main/java/okhttp3/slack/OAuthSessionFactory.java

        return ByteString.of(bytes);
      }
    
      private HttpUrl redirectUrl() {
        return mockWebServer.url("/oauth/");
      }
    
      /** When the browser hits the redirect URL, use the provided code to ask Slack for a session. */
      @Override public MockResponse dispatch(RecordedRequest request) {
        HttpUrl requestUrl = mockWebServer.url(request.getPath());
        String code = requestUrl.queryParameter("code");
    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/guide/src/main/java/okhttp3/recipes/PrintEventsNonConcurrent.java

        }
    
        @Override public void callStart(Call call) {
          printEvent("callStart");
        }
    
        @Override public void proxySelectStart(Call call, HttpUrl url) {
          printEvent("proxySelectStart");
        }
    
        @Override public void proxySelectEnd(Call call, HttpUrl url, List<Proxy> proxies) {
          printEvent("proxySelectEnd");
        }
    
        @Override public void dnsStart(Call call, String domainName) {
          printEvent("dnsStart");
    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)
  8. samples/guide/src/main/java/okhttp3/recipes/PreemptiveAuth.java

            .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()) {
          if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
    
    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)
  9. regression-test/src/androidTest/java/okhttp/regression/LetsEncryptTest.java

          }
        } catch (SSLHandshakeException sslhe) {
          assertTrue(androidMorEarlier);
        }
      }
    
      private void sendRequest(OkHttpClient client, String url) throws IOException {
        Request request = new Request.Builder()
                .url(url)
                .build();
        try (Response response = client.newCall(request).execute()) {
          assertTrue(response.code() == 200 || response.code() == 404);
    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/CancelCall.java

      private final OkHttpClient client = new OkHttpClient();
    
      public void run() throws Exception {
        Request request = new Request.Builder()
            .url("http://httpbin.org/delay/2") // This URL is served with a 2 second delay.
            .build();
    
        final long startNanos = System.nanoTime();
        final Call call = client.newCall(request);
    
        // Schedule a job to cancel the call in 1 second.
    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)
Back to top