Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for json (0.16 sec)

  1. samples/guide/src/main/java/okhttp3/recipes/kt/PostPath.kt

      private val client = OkHttpClient()
      private val fileSystem = FakeFileSystem()
      val path = "test.json".toPath()
    
      fun run() {
        fileSystem.write(path) {
          writeUtf8("{}")
        }
    
        val request =
          Request.Builder()
            .url("https://httpbin.org/anything")
            .put(path.asRequestBody(fileSystem, MEDIA_TYPE_JSON))
            .build()
    
        client.newCall(request).execute().use { response ->
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.6K bytes
    - Viewed (0)
  2. okhttp/build.gradle.kts

      testImplementation(libs.kotlin.test.annotations)
      testImplementation(libs.kotlin.test.common)
      testImplementation(libs.kotlinx.serialization.core)
      testImplementation(libs.kotlinx.serialization.json)
      testImplementation(projects.okhttpJavaNetCookiejar)
      testImplementation(projects.okhttpTls)
      testImplementation(projects.okhttpUrlconnection)
      testImplementation(projects.mockwebserver3)
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Jan 04 05:32:07 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  3. samples/guide/src/main/java/okhttp3/recipes/kt/AccessHeaders.kt

          Request.Builder()
            .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()
    
        client.newCall(request).execute().use { response ->
          if (!response.isSuccessful) throw IOException("Unexpected code $response")
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.4K bytes
    - Viewed (0)
  4. okcurl/src/test/kotlin/okhttp3/curl/MainTest.kt

            "-d",
            "foo",
            "-H",
            "Content-Type: application/json",
            "http://example.com",
          ).createRequest()
        val body = request.body
        assertThat(request.method).isEqualTo("POST")
        assertThat(request.url.toString()).isEqualTo("http://example.com/")
        assertThat(body!!.contentType().toString())
          .isEqualTo("application/json; charset=utf-8")
        assertThat(bodyAsString(body)).isEqualTo("foo")
      }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.3K bytes
    - Viewed (0)
  5. docs/recipes.md

              System.out.println(response.body().string());
            }
          }
        ```
    
    ### Parse a JSON Response With Moshi ([.kt][ParseResponseWithMoshiKotlin], [.java][ParseResponseWithMoshiJava])
    
    [Moshi](https://github.com/square/moshi) is a handy API for converting between JSON and Java objects. Here we're using it to decode a JSON response from a GitHub API.
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Fri Feb 18 08:52:22 GMT 2022
    - 40.2K bytes
    - Viewed (1)
  6. okhttp/src/test/resources/okhttp3/internal/publicsuffix/public_suffix_list.dat

    mydobiss.com
    
    // FH Muenster : https://www.fh-muenster.de
    // Submitted by Robin Naundorf <******@****.***>
    fh-muenster.io
    
    // Filegear Inc. : https://www.filegear.com
    // Submitted by Jason Zhu <jason@owtware.com>
    filegear.me
    filegear-au.me
    filegear-de.me
    filegear-gb.me
    filegear-ie.me
    filegear-jp.me
    filegear-sg.me
    
    // Firebase, Inc.
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Wed Dec 20 23:27:07 GMT 2023
    - 240.3K bytes
    - Viewed (3)
  7. okhttp-idna-mapping-table/src/main/resources/okhttp3/internal/idna/IdnaMappingTable.txt

    17EA..17EF    ; disallowed                             # NA   <reserved-17EA>..<reserved-17EF>
    17F0..17F9    ; valid                  ;      ; NV8    # 4.0  KHMER SYMBOL LEK ATTAK SON..KHMER SYMBOL LEK ATTAK PRAM-BUON
    17FA..17FF    ; disallowed                             # NA   <reserved-17FA>..<reserved-17FF>
    1800..1805    ; valid                  ;      ; NV8    # 3.0  MONGOLIAN BIRGA..MONGOLIAN FOUR DOTS
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Feb 10 11:25:47 GMT 2024
    - 854.1K bytes
    - Viewed (2)
  8. mockwebserver/README.md

    You can set a custom body with a string, input stream or byte array. Also
    add headers with a fluent builder API.
    
    ```java
    MockResponse response = new MockResponse()
        .addHeader("Content-Type", "application/json; charset=utf-8")
        .addHeader("Cache-Control", "no-cache")
        .setBody("{}");
    ```
    
    MockResponse can be used to simulate a slow network. This is useful for
    testing timeouts and interactive testing.
    
    ```java
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun Dec 17 15:34:10 GMT 2023
    - 5K bytes
    - Viewed (1)
  9. gradle/libs.versions.toml

    kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kotlinx-serialization" }
    kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" }
    mockserver = { module = "org.testcontainers:mockserver", version.ref = "testcontainers" }
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Apr 22 19:34:32 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/WebPlatformToAsciiData.kt

    package okhttp3
    
    import kotlinx.serialization.Serializable
    import kotlinx.serialization.decodeFromString
    import kotlinx.serialization.json.Json
    
    /**
     * A test from the [Web Platform To ASCII](https://github.com/web-platform-tests/wpt/blob/master/url/resources/toascii.json).
     *
     * Each test is a line of the file `toascii.json`.
     */
    @Serializable
    class WebPlatformToAsciiData {
      var input: String? = null
      var output: String? = null
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Wed Dec 20 23:27:07 GMT 2023
    - 1.4K bytes
    - Viewed (0)
Back to top