Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for toRequestBody (0.11 sec)

  1. okhttp/src/jvmTest/kotlin/okhttp3/RequestBodyTest.kt

        assertOnFileDescriptor { fd ->
          val requestBody = fd.toRequestBody()
    
          assertThat(requestBody.contentLength()).isEqualTo(-1L)
          assertThat(requestBody.isOneShot()).isEqualTo(true)
        }
      }
    
      @Test
      fun testFileDescriptorRead() {
        assertOnFileDescriptor(content = "Hello") { fd ->
          val requestBody = fd.toRequestBody()
    
          val buffer = Buffer()
          requestBody.writeTo(buffer)
    Registered: 2025-05-30 11:42
    - Last Modified: 2025-03-19 19:25
    - 3.6K bytes
    - Viewed (0)
  2. okhttp/src/jvmTest/kotlin/okhttp3/CommonRequestBodyTest.kt

    package okhttp3
    
    import assertk.assertThat
    import assertk.assertions.isEqualTo
    import kotlin.test.Test
    import okhttp3.RequestBody.Companion.toRequestBody
    
    class CommonRequestBodyTest {
      @Test
      fun correctContentType() {
        val body = "Body"
        val requestBody = body.toRequestBody(MediaType("text/plain", "text", "plain", arrayOf()))
    
        val contentType = requestBody.contentType()!!
    
    Registered: 2025-05-30 11:42
    - Last Modified: 2024-12-27 13:39
    - 1.1K bytes
    - Viewed (0)
  3. okcurl/src/main/kotlin/okhttp3/curl/internal/-MainCommon.kt

    package okhttp3.curl.internal
    
    import java.io.IOException
    import okhttp3.MediaType
    import okhttp3.MediaType.Companion.toMediaTypeOrNull
    import okhttp3.Request
    import okhttp3.RequestBody.Companion.toRequestBody
    import okhttp3.curl.Main
    import okhttp3.internal.http.StatusLine
    import okio.sink
    
    internal fun Main.commonCreateRequest(): Request {
      val request = Request.Builder()
    
    Registered: 2025-05-30 11:42
    - Last Modified: 2025-03-19 19:25
    - 2.7K bytes
    - Viewed (0)
  4. okhttp-dnsoverhttps/src/main/kotlin/okhttp3/dnsoverhttps/DnsOverHttps.kt

    import okhttp3.HttpUrl
    import okhttp3.MediaType
    import okhttp3.MediaType.Companion.toMediaType
    import okhttp3.OkHttpClient
    import okhttp3.Protocol
    import okhttp3.Request
    import okhttp3.RequestBody.Companion.toRequestBody
    import okhttp3.Response
    import okhttp3.internal.platform.Platform
    import okhttp3.internal.publicsuffix.PublicSuffixDatabase
    
    /**
     * [DNS over HTTPS implementation][doh_spec].
     *
    Registered: 2025-05-30 11:42
    - Last Modified: 2025-05-10 11:15
    - 8.6K bytes
    - Viewed (0)
  5. okhttp/src/jvmTest/kotlin/okhttp3/CallKotlinTest.kt

    import mockwebserver3.SocketPolicy.ShutdownOutputAtEnd
    import okhttp3.Headers.Companion.headersOf
    import okhttp3.MediaType.Companion.toMediaType
    import okhttp3.RequestBody.Companion.toRequestBody
    import okhttp3.TestUtil.assertSuppressed
    import okhttp3.internal.DoubleInetAddressDns
    import okhttp3.internal.connection.RealConnection
    import okhttp3.internal.connection.RealConnection.Companion.IDLE_CONNECTION_HEALTHY_NS
    Registered: 2025-05-30 11:42
    - Last Modified: 2025-03-19 19:25
    - 8.4K bytes
    - Viewed (0)
Back to top