Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for isOneShot (0.19 sec)

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

          |
          """.trimMargin().replace("\n", "\r\n")
        val body =
          MultipartBody.Builder("123")
            .addPart("Hello, World!".toRequestBody(null))
            .build()
    
        assertThat(body.isOneShot()).isEqualTo(false)
    
        val buffer = Buffer()
        body.writeTo(buffer)
        assertThat(body.contentLength()).isEqualTo(buffer.size)
        assertThat(buffer.readUtf8()).isEqualTo(expected)
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.4K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/RequestBody.kt

            @Throws(IOException::class)
            override fun writeTo(sink: BufferedSink) {
              GzipSink(sink).buffer().use(this@gzip::writeTo)
            }
    
            override fun isOneShot(): Boolean {
              return this@gzip.isOneShot()
            }
          }
        }
      }
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Jan 25 14:41:37 GMT 2024
    - 9.6K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/internal/http/RetryAndFollowUpInterceptor.kt

              }
              closeActiveExchange = false
              return response
            }
    
            val followUpBody = followUp.body
            if (followUpBody != null && followUpBody.isOneShot()) {
              closeActiveExchange = false
              return response
            }
    
            response.body.closeQuietly()
    
            if (++followUpCount > MAX_FOLLOW_UPS) {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Apr 15 13:24:48 GMT 2024
    - 12.1K bytes
    - Viewed (4)
  4. okhttp/src/test/java/okhttp3/RequestBodyTest.kt

      }
    
      @Test
      fun testFileDescriptor() {
        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()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.6K bytes
    - Viewed (1)
  5. okhttp/src/main/kotlin/okhttp3/MultipartBody.kt

      /** The number of parts in this multipart body. */
      @get:JvmName("size")
      val size: Int
        get() = parts.size
    
      fun part(index: Int): Part = parts[index]
    
      override fun isOneShot(): Boolean {
        return parts.any { it.body.isOneShot() }
      }
    
      /** A combination of [type] and [boundaryByteString]. */
      override fun contentType(): MediaType = contentType
    
      @JvmName("-deprecated_type")
      @Deprecated(
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.9K bytes
    - Viewed (0)
  6. okhttp-logging-interceptor/src/main/kotlin/okhttp3/logging/HttpLoggingInterceptor.kt

              logger.log("--> END ${request.method} (encoded body omitted)")
            } else if (requestBody.isDuplex()) {
              logger.log("--> END ${request.method} (duplex request body omitted)")
            } else if (requestBody.isOneShot()) {
              logger.log("--> END ${request.method} (one-shot body omitted)")
            } else {
              var buffer = Buffer()
              requestBody.writeTo(buffer)
    
              var gzippedLength: Long? = null
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Apr 06 09:14:38 GMT 2024
    - 11.2K bytes
    - Viewed (1)
  7. docs/changelogs/changelog_4x.md

        between Kotlin's `assert()` and Java's `assert()`. (Kotlin always evaluates the argument; Java
        only does when assertions are enabled.)
    
     *  Fix: Honor `RequestBody.isOneShot()` in `HttpLoggingInterceptor`.
    
    
    ## Version 4.2.2
    
    _2019-10-06_
    
     *  Fix: When closing a canceled HTTP/2 stream, don't send the `END_STREAM` flag. This could cause
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Wed Apr 17 13:25:31 GMT 2024
    - 25.2K bytes
    - Viewed (0)
  8. okhttp-logging-interceptor/src/test/java/okhttp3/logging/HttpLoggingInterceptorTest.kt

              counter++
              assertThat(counter).isLessThanOrEqualTo(1)
              sink.writeUtf8("Hello request!")
              sink.close()
            }
    
            override fun isOneShot() = true
          }
        val request =
          request()
            .post(asyncRequestBody)
            .build()
        val response = client.newCall(request).execute()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Apr 06 09:14:38 GMT 2024
    - 37.6K bytes
    - Viewed (0)
  9. CHANGELOG.md

     *  New: `OkHttpClient.webSocketCloseTimeout` configures how long a web socket connection will wait
        for a graceful shutdown before it performs an abrupt shutdown.
    
     *  Fix: Honor `RequestBody.isOneShot()` in `MultipartBody`
    
     *  Fix in `okhttp-coroutines`: Don't leak response bodies in `executeAsync()`. We had a bug where
        we didn't call `Response.close()` if the coroutine was canceled before its response was
        returned.
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Apr 18 01:31:39 GMT 2024
    - 21.4K bytes
    - Viewed (0)
  10. okhttp/api/okhttp.api

    	public final fun -deprecated_type ()Lokhttp3/MediaType;
    	public final fun boundary ()Ljava/lang/String;
    	public fun contentLength ()J
    	public fun contentType ()Lokhttp3/MediaType;
    	public fun isOneShot ()Z
    	public final fun part (I)Lokhttp3/MultipartBody$Part;
    	public final fun parts ()Ljava/util/List;
    	public final fun size ()I
    	public final fun type ()Lokhttp3/MediaType;
    	public fun writeTo (Lokio/BufferedSink;)V
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Apr 15 13:41:01 GMT 2024
    - 70.2K bytes
    - Viewed (0)
Back to top