Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 107 for body (0.2 sec)

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

        String response1Body;
        try (Response response1 = client.newCall(request).execute()) {
          if (!response1.isSuccessful()) throw new IOException("Unexpected code " + response1);
    
          response1Body = response1.body().string();
          System.out.println("Response 1 response:          " + response1);
          System.out.println("Response 1 cache response:    " + response1.cacheResponse());
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun May 22 01:29:42 GMT 2016
    - 2.4K bytes
    - Viewed (0)
  2. samples/simple-client/src/main/java/okhttp3/sample/OkHttpContributors.java

        try (Response response = client.newCall(request).execute()) {
          // Deserialize HTTP response to concrete type.
          ResponseBody body = response.body();
          List<Contributor> contributors = CONTRIBUTORS_JSON_ADAPTER.fromJson(body.source());
    
          // Sort list by the most contributions.
          Collections.sort(contributors, (c1, c2) -> c2.contributions - c1.contributions);
    
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Fri Apr 05 03:30:42 GMT 2024
    - 2.2K bytes
    - Viewed (0)
  3. samples/guide/src/main/java/okhttp3/guide/PostExample.java

      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();
        }
      }
    
      String bowlingJson(String player1, String player2) {
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Fri Apr 05 03:30:42 GMT 2024
    - 2K bytes
    - Viewed (0)
  4. samples/slack/src/main/java/okhttp3/slack/RtmSession.java

        RtmStartResponse rtmStartResponse = slackApi.rtmStart(accessToken);
        webSocket = slackApi.rtm(rtmStartResponse.url, this);
      }
    
      // TODO(jwilson): can I read the response body? Do I have to?
      //                the body from slack is a 0-byte-buffer
      @Override public synchronized void onOpen(WebSocket webSocket, Response response) {
        System.out.println("onOpen: " + response);
      }
    
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Nov 19 20:16:58 GMT 2016
    - 2.4K bytes
    - Viewed (0)
  5. samples/guide/src/main/java/okhttp3/recipes/Progress.java

              return originalResponse.newBuilder()
                  .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                  .build();
            })
            .build();
    
        try (Response response = client.newCall(request).execute()) {
          if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
    
          System.out.println(response.body().string());
        }
      }
    
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Jan 12 03:31:36 GMT 2019
    - 3.9K bytes
    - Viewed (0)
  6. samples/static-server/src/main/java/okhttp3/sample/SampleServer.java

        response.append(String.format("<html><head><title>%s</title></head><body>", basePath));
        response.append(String.format("<h1>%s</h1>", basePath));
        for (String file : directory.list()) {
          response.append(String.format("<div class='file'><a href='%s'>%s</a></div>",
              basePath + file, file));
        }
        response.append("</body></html>");
    
        return new MockResponse()
            .setStatus("HTTP/1.1 200")
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Wed Jan 02 02:50:44 GMT 2019
    - 4.7K bytes
    - Viewed (0)
  7. samples/slack/src/main/java/okhttp3/slack/SlackApi.java

        Call call = httpClient.newCall(request);
        try (Response response = call.execute()) {
          JsonAdapter<OAuthSession> jsonAdapter = moshi.adapter(OAuthSession.class);
          return jsonAdapter.fromJson(response.body().source());
        }
      }
    
      /** See https://api.slack.com/methods/rtm.start. */
      public RtmStartResponse rtmStart(String accessToken) throws IOException {
        HttpUrl url = baseUrl.newBuilder("rtm.start")
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Fri Jul 06 19:30:55 GMT 2018
    - 4.4K bytes
    - Viewed (1)
  8. src/test/java/org/codelibs/fess/it/admin/FileAuthTests.java

            requestBody.put("available", true);
            requestBody.put("sort_order", 1);
            checkMethodBase(requestBody).put("/api/admin/fileconfig/setting").then().body("response.created", equalTo(true))
                    .body("response.status", equalTo(0));
        }
    
        String getFileConfigId() {
            final Map<String, Object> searchBody = new HashMap<>();
            searchBody.put("name", "test_fileconfig");
    Java
    - Registered: Mon Apr 29 08:04:11 GMT 2024
    - Last Modified: Thu Feb 22 01:37:57 GMT 2024
    - 3.9K bytes
    - Viewed (0)
  9. samples/unixdomainsockets/src/main/java/okhttp3/unixdomainsockets/ClientAndServer.java

        Request request = new Request.Builder()
            .url("http://publicobject.com/helloworld.txt")
            .build();
    
        try (Response response = client.newCall(request).execute()) {
          System.out.println(response.body().string());
        }
    
        server.shutdown();
        socketFile.delete();
      }
    
      public static void main(String... args) throws Exception {
        new ClientAndServer().run();
      }
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Dec 24 03:46:30 GMT 2018
    - 2.1K bytes
    - Viewed (0)
  10. src/test/java/org/codelibs/fess/it/admin/WebAuthTests.java

            requestBody.put("available", true);
            requestBody.put("sort_order", 1);
            checkMethodBase(requestBody).put("/api/admin/webconfig/setting").then().body("response.created", equalTo(true))
                    .body("response.status", equalTo(0));
        }
    
        String getWebConfigId() {
            final Map<String, Object> searchBody = new HashMap<>();
            searchBody.put("name", "test_webconfig");
    Java
    - Registered: Mon Apr 29 08:04:11 GMT 2024
    - Last Modified: Thu Feb 22 01:37:57 GMT 2024
    - 3.9K bytes
    - Viewed (0)
Back to top