Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for json (0.23 sec)

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

       *
       * https://console.developers.google.com/project
       */
      public static final String GOOGLE_API_KEY = "AIzaSyAx2WZYe0My0i-uGurpvraYJxO7XNbwiGs";
      public static final MediaType MEDIA_TYPE_JSON = MediaType.get("application/json");
    
      private final OkHttpClient client = new OkHttpClient.Builder()
          .addInterceptor(new GzipRequestInterceptor())
          .build();
      private final Moshi moshi = new Moshi.Builder().build();
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat May 25 18:02:55 GMT 2019
    - 3.8K bytes
    - Viewed (0)
  2. samples/simple-client/src/main/java/okhttp3/sample/OkHttpContributors.java

      private static final String ENDPOINT = "https://api.github.com/repos/square/okhttp/contributors";
      private static final Moshi MOSHI = new Moshi.Builder().build();
      private static final JsonAdapter<List<Contributor>> CONTRIBUTORS_JSON_ADAPTER = MOSHI.adapter(
          Types.newParameterizedType(List.class, Contributor.class));
    
      static class Contributor {
        String login;
        int 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/recipes/AccessHeaders.java

            .url("https://api.github.com/repos/square/okhttp/issues")
            .header("User-Agent", "OkHttp Headers.java")
            .addHeader("Accept", "application/json; q=0.5")
            .addHeader("Accept", "application/vnd.github.v3+json")
            .build();
    
        try (Response response = client.newCall(request).execute()) {
          if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
    
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun May 22 01:29:42 GMT 2016
    - 1.6K bytes
    - Viewed (0)
  4. samples/guide/src/main/java/okhttp3/guide/PostExample.java

    import okhttp3.RequestBody;
    import okhttp3.Response;
    
    public class PostExample {
      public static final MediaType JSON = MediaType.get("application/json; charset=utf-8");
    
      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();
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Fri Apr 05 03:30:42 GMT 2024
    - 2K bytes
    - Viewed (0)
Back to top