Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 50 for body (0.34 sec)

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

    class ResponseBodyJvmTest {
      @Test
      fun stringEmpty() {
        val body = body("")
        assertThat(body.string()).isEqualTo("")
      }
    
      @Test
      fun stringLooksLikeBomButTooShort() {
        val body = body("000048")
        assertThat(body.string()).isEqualTo("\u0000\u0000H")
      }
    
      @Test
      fun stringDefaultsToUtf8() {
        val body = body("68656c6c6f")
        assertThat(body.string()).isEqualTo("hello")
      }
    
      @Test
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13K bytes
    - Viewed (0)
  2. 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)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 09:14:38 GMT 2024
    - 11.2K bytes
    - Viewed (1)
  3. okhttp/src/main/kotlin/okhttp3/internal/connection/RealCall.kt

      // the call, but they may be accessed by other threads for duplex requests.
    
      /** True if this call still has a request body open. */
      private var requestBodyOpen = false
    
      /** True if this call still has a response body open. */
      private var responseBodyOpen = false
    
      /** True if there are more exchanges expected for this call. */
      private var expectMoreExchanges = true
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 17.9K bytes
    - Viewed (2)
  4. docs/changelogs/changelog_4x.md

        ```kotlin
        val response: Response = call.execute()
        val multipartReader = MultipartReader(response.body!!)
    
        multipartReader.use {
          while (true) {
            val part = multipartReader.nextPart() ?: break
            process(part.headers, part.body)
          }
        }
        ```
    
     *  New: `MediaType.parameter()` gets a parameter like `boundary` from a media type like
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 17 13:25:31 GMT 2024
    - 25.2K bytes
    - Viewed (0)
  5. mockwebserver/src/main/kotlin/mockwebserver3/MockResponse.kt

          }
    
        fun body(body: Buffer) = body(body.toMockResponseBody())
    
        fun body(body: MockResponseBody) =
          apply {
            setHeader("Content-Length", body.contentLength)
            this.body = body
          }
    
        /** Sets the response body to the UTF-8 encoded bytes of [body]. */
        fun body(body: String): Builder = body(Buffer().writeUtf8(body))
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 23 14:31:42 GMT 2024
    - 13.3K bytes
    - Viewed (1)
  6. okhttp/src/main/kotlin/okhttp3/internal/http1/Http1ExchangeCodec.kt

        state = STATE_READING_RESPONSE_BODY
        return FixedLengthSource(length)
      }
    
      private fun newChunkedSource(url: HttpUrl): Source {
        check(state == STATE_OPEN_RESPONSE_BODY) { "state: $state" }
        state = STATE_READING_RESPONSE_BODY
        return ChunkedSource(url)
      }
    
      private fun newUnknownLengthSource(): Source {
        check(state == STATE_OPEN_RESPONSE_BODY) { "state: $state" }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 16.2K bytes
    - Viewed (0)
  7. okhttp-logging-interceptor/src/test/java/okhttp3/logging/HttpLoggingInterceptorTest.kt

        applicationLogs
          .assertLogEqual("--> POST $url (3-byte body)")
          .assertLogMatch(Regex("""<-- 200 OK $url \(\d+ms, 0-byte body\)"""))
          .assertNoMoreLogs()
        networkLogs
          .assertLogEqual("--> POST $url http/1.1 (3-byte body)")
          .assertLogMatch(Regex("""<-- 200 OK $url \(\d+ms, 0-byte body\)"""))
          .assertNoMoreLogs()
      }
    
      @Test
      fun basicResponseBody() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 09:14:38 GMT 2024
    - 37.6K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/Response.kt

       * before the entire HTTP response body has been consumed.
       */
      @Throws(IOException::class)
      fun trailers(): Headers = trailersFn()
    
      /**
       * Peeks up to [byteCount] bytes from the response body and returns them as a new response
       * body. If fewer than [byteCount] bytes are in the response body, the full response body is
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 23 14:31:42 GMT 2024
    - 15.5K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/MultipartReaderTest.kt

            "abc",
          ),
        )
        assertThat(partAbc.body.readUtf8()).isEqualTo("abcd\r\nefgh")
    
        val partIjk = parts.nextPart()!!
        assertThat(partIjk.headers).isEqualTo(
          headersOf(
            "Content-Type",
            "text/plain; charset=utf-8",
            "Content-ID",
            "ijk",
          ),
        )
        assertThat(partIjk.body.readUtf8()).isEqualTo("ijkl\r\nmnop\r\n")
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13.8K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/MultipartBodyTest.kt

        assertThat(body.boundary).isEqualTo("123")
        assertThat(body.type).isEqualTo(MultipartBody.MIXED)
        assertThat(body.contentType().toString())
          .isEqualTo("multipart/mixed; boundary=123")
        assertThat(body.parts.size).isEqualTo(1)
        assertThat(body.contentLength()).isEqualTo(33L)
        val buffer = Buffer()
        body.writeTo(buffer)
        assertThat(body.contentLength()).isEqualTo(buffer.size)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.4K bytes
    - Viewed (0)
Back to top