Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for peekBody (0.22 sec)

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

        val response = newResponse(responseBody("abcdef"))
        val peekedBody = response.peekBody(3)
        assertThat(peekedBody.string()).isEqualTo("abc")
        assertThat(response.body.string()).isEqualTo("abcdef")
      }
    
      @Test fun peekLongerThanResponse() {
        val response = newResponse(responseBody("abc"))
        val peekedBody = response.peekBody(6)
        assertThat(peekedBody.string()).isEqualTo("abc")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.6K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/ResponseJvmTest.kt

      }
    
      @Test fun peekAfterReadingResponse() {
        val response = newResponse(responseBody("abc"))
        assertThat(response.body.string()).isEqualTo("abc")
    
        assertFailsWith<IllegalStateException> {
          response.peekBody(3)
        }
      }
    
      /**
       * Returns a new response body that refuses to be read once it has been closed. This is true of
       * most [BufferedSource] instances, but not of [Buffer].
       */
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.1K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/Response.kt

       *
       * **Warning:** this method loads the requested bytes into memory. Most applications should set
       * a modest limit on `byteCount`, such as 1 MiB.
       */
      @Throws(IOException::class)
      fun peekBody(byteCount: Long): ResponseBody {
        val peeked = body.source().peek()
        val buffer = Buffer()
        peeked.request(byteCount)
        buffer.write(peeked, minOf(byteCount, peeked.buffer.size))
    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)
  4. okhttp/src/test/java/okhttp3/KotlinSourceModernTest.kt

        val header: String? = response.header("")
        val headers: Headers = response.headers
        val trailers: Headers = response.trailers()
        val peekBody: ResponseBody = response.peekBody(0L)
        val body: ResponseBody = response.body
        val builder: Response.Builder = response.newBuilder()
        val redirect: Boolean = response.isRedirect
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 01 14:21:25 GMT 2024
    - 46.5K bytes
    - Viewed (4)
  5. docs/changelogs/changelog_3x.md

        forbidden by `URI`.
     *  Fix: When a connect times out, attempt an alternate route. Previously route
        selection was less efficient when differentiating failures.
     *  New: `Response.peekBody()` lets you access the response body without
        consuming it. This may be handy for interceptors!
     *  New: `HttpUrl.newBuilder()` resolves a link to a builder.
     *  New: Add the TLS version to the `Handshake`.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 14:55:54 GMT 2022
    - 50.8K bytes
    - Viewed (0)
  6. okhttp/api/okhttp.api

    	public final fun isSuccessful ()Z
    	public final fun message ()Ljava/lang/String;
    	public final fun networkResponse ()Lokhttp3/Response;
    	public final fun newBuilder ()Lokhttp3/Response$Builder;
    	public final fun peekBody (J)Lokhttp3/ResponseBody;
    	public final fun priorResponse ()Lokhttp3/Response;
    	public final fun protocol ()Lokhttp3/Protocol;
    	public final fun receivedResponseAtMillis ()J
    	public final fun request ()Lokhttp3/Request;
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 15 13:41:01 GMT 2024
    - 70.2K bytes
    - Viewed (0)
Back to top