Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for FromJSON (0.13 sec)

  1. okhttp-hpacktests/src/test/java/okhttp3/internal/http2/hpackjson/HpackJsonUtil.kt

              @FromJson fun byteStringFromJson(json: String) = json.decodeHex()
            },
          )
          .add(KotlinJsonAdapterFactory())
          .build()
      private val STORY_JSON_ADAPTER = MOSHI.adapter(Story::class.java)
    
      private val fileSystem = FileSystem.SYSTEM
    
      private fun readStory(source: BufferedSource): Story {
        return STORY_JSON_ADAPTER.fromJson(source)!!
      }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  2. samples/slack/src/main/java/okhttp3/slack/SlackApi.java

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    package okhttp3.slack;
    
    import com.squareup.moshi.FromJson;
    import com.squareup.moshi.JsonAdapter;
    import com.squareup.moshi.Moshi;
    import com.squareup.moshi.ToJson;
    import java.io.IOException;
    import okhttp3.Call;
    import okhttp3.HttpUrl;
    import okhttp3.WebSocket;
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Fri Jul 06 19:30:55 UTC 2018
    - 4.4K bytes
    - Viewed (0)
  3. samples/guide/src/main/java/okhttp3/recipes/kt/ParseResponseWithMoshi.kt

            .build()
        client.newCall(request).execute().use { response ->
          if (!response.isSuccessful) throw IOException("Unexpected code $response")
    
          val gist = gistJsonAdapter.fromJson(response.body!!.source())
    
          for ((key, value) in gist!!.files!!) {
            println(key)
            println(value.content)
          }
        }
      }
    
      @JsonClass(generateAdapter = true)
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  4. samples/guide/src/main/java/okhttp3/recipes/ParseResponseWithMoshi.java

            .build();
        try (Response response = client.newCall(request).execute()) {
          if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
    
          Gist gist = gistJsonAdapter.fromJson(response.body().source());
    
          for (Map.Entry<String, GistFile> entry : gist.files.entrySet()) {
            System.out.println(entry.getKey());
            System.out.println(entry.getValue().content);
          }
        }
      }
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun May 22 01:29:42 UTC 2016
    - 1.8K bytes
    - Viewed (0)
  5. 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);
    
          // Output list of contributors.
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Fri Apr 05 03:30:42 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  6. .github/workflows/build-docs.yml

      build-docs:
        needs:
          - changes
          - langs
        if: ${{ needs.changes.outputs.docs == 'true' }}
        runs-on: ubuntu-latest
        strategy:
          matrix:
            lang: ${{ fromJson(needs.langs.outputs.langs) }}
        steps:
          - name: Dump GitHub context
            env:
              GITHUB_CONTEXT: ${{ toJson(github) }}
            run: echo "$GITHUB_CONTEXT"
          - uses: actions/checkout@v4
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Oct 12 12:27:19 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  7. docs/recipes.md

                .build()
            client.newCall(request).execute().use { response ->
              if (!response.isSuccessful) throw IOException("Unexpected code $response")
    
              val gist = gistJsonAdapter.fromJson(response.body!!.source())
    
              for ((key, value) in gist!!.files!!) {
                println(key)
                println(value.content)
              }
            }
          }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Fri Feb 18 08:52:22 UTC 2022
    - 40.2K bytes
    - Viewed (0)
  8. android-test/src/androidTest/java/okhttp/android/test/OkHttpTest.kt

        val response = client.newCall(request).execute()
    
        val results =
          response.use {
            moshi.adapter(HowsMySslResults::class.java).fromJson(response.body.string())!!
          }
    
        Platform.get().log("results $results", Platform.WARN)
    
        assertTrue(results.session_ticket_supported)
        assertEquals("Probably Okay", results.rating)
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 27K bytes
    - Viewed (0)
Back to top