Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for toOneShotRequestBody (0.23 sec)

  1. okhttp/src/test/java/okhttp3/MultipartBodyTest.kt

          MultipartBody.Builder("123")
            .addPart("Hello, World!".toOneShotRequestBody())
            .build()
    
        assertThat(body.isOneShot()).isEqualTo(true)
    
        val buffer = Buffer()
        body.writeTo(buffer)
        assertThat(body.contentLength()).isEqualTo(buffer.size)
        assertThat(buffer.readUtf8()).isEqualTo(expected)
      }
    
      fun String.toOneShotRequestBody(): RequestBody {
        return object : RequestBody() {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 10.4K bytes
    - Viewed (0)
Back to top