Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 51 for ResponseBody (0.56 sec)

  1. okhttp/src/main/kotlin/okhttp3/ResponseBody.kt

     *
     * ```java
     * Call call = client.newCall(request);
     * call.enqueue(new Callback() {
     *   public void onResponse(Call call, Response response) throws IOException {
     *     try (ResponseBody responseBody = response.body()) {
     *     ... // Use the response.
     *     }
     *   }
     *
     *   public void onFailure(Call call, IOException e) {
     *   ... // Handle the failure.
     *   }
     * });
     * ```
     *
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.7K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/-ResponseBodyCommon.kt

    package okhttp3.internal
    
    import okhttp3.MediaType
    import okhttp3.ResponseBody
    import okhttp3.ResponseBody.Companion.asResponseBody
    import okio.Buffer
    import okio.BufferedSource
    import okio.ByteString
    import okio.IOException
    import okio.use
    
    internal fun ResponseBody.commonBytes() = commonConsumeSource(BufferedSource::readByteArray) { it.size }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.3K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/DuplexTest.kt

          val responseBody = response.body.source()
          assertThat(responseBody.readUtf8Line())
            .isEqualTo("response A")
          assertThat(responseBody.readUtf8Line())
            .isEqualTo("response B")
          requestBody.writeUtf8("request C\n")
          requestBody.close()
          assertThat(responseBody.readUtf8Line()).isNull()
        }
        body.awaitSuccess()
      }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 23.9K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/internal/-ResponseCommon.kt

    import okhttp3.CacheControl
    import okhttp3.Headers
    import okhttp3.MediaType
    import okhttp3.Protocol
    import okhttp3.Request
    import okhttp3.Response
    import okhttp3.ResponseBody
    import okhttp3.ResponseBody.Companion.asResponseBody
    import okhttp3.internal.http.HTTP_PERM_REDIRECT
    import okhttp3.internal.http.HTTP_TEMP_REDIRECT
    import okio.Buffer
    import okio.IOException
    import okio.Source
    import okio.Timeout
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Apr 15 13:24:48 GMT 2024
    - 5.2K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/ResponseBodyJvmTest.kt

        assertThat(body.string()).isEqualTo("hello")
      }
    
      @Test
      fun stringClosesUnderlyingSource() {
        val closed = AtomicBoolean()
        val body: ResponseBody =
          object : ResponseBody() {
            override fun contentType(): MediaType? {
              return null
            }
    
            override fun contentLength(): Long {
              return 5
            }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/internal/http/ThreadInterruptTest.kt

              .build(),
          )
        val response = call.execute()
        interruptLater(500)
        val responseBody = response.body.byteStream()
        val buffer = ByteArray(1024)
        assertFailsWith<IOException> {
          while (responseBody.read(buffer) != -1) {
          }
        }
        responseBody.close()
      }
    
      private fun sleep(delayMillis: Int) {
        try {
          Thread.sleep(delayMillis.toLong())
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/ResponseCommonTest.kt

      }
    
      private fun newResponse(
        responseBody: ResponseBody,
        code: Int = 200,
      ): Response {
        return Response.Builder()
          .request(
            Request.Builder()
              .url("https://example.com/")
              .build(),
          )
          .protocol(Protocol.HTTP_1_1)
          .code(code)
          .message("OK")
          .body(responseBody)
          .build()
      }
    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 (0)
  8. okhttp/api/okhttp.api

    	public final fun create (Lokhttp3/MediaType;JLokio/BufferedSource;)Lokhttp3/ResponseBody;
    	public final fun create (Lokhttp3/MediaType;Ljava/lang/String;)Lokhttp3/ResponseBody;
    	public final fun create (Lokhttp3/MediaType;Lokio/ByteString;)Lokhttp3/ResponseBody;
    	public final fun create (Lokhttp3/MediaType;[B)Lokhttp3/ResponseBody;
    	public final fun create (Lokio/BufferedSource;Lokhttp3/MediaType;J)Lokhttp3/ResponseBody;
    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)
  9. okhttp-sse/src/main/kotlin/okhttp3/sse/internal/RealEventSource.kt

     * limitations under the License.
     */
    package okhttp3.sse.internal
    
    import java.io.IOException
    import okhttp3.Call
    import okhttp3.Callback
    import okhttp3.Request
    import okhttp3.Response
    import okhttp3.ResponseBody
    import okhttp3.internal.stripBody
    import okhttp3.sse.EventSource
    import okhttp3.sse.EventSourceListener
    
    internal class RealEventSource(
      private val request: Request,
      private val listener: EventSourceListener,
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.2K bytes
    - Viewed (0)
  10. okhttp-testing-support/src/main/kotlin/okhttp3/ForwardingResponseBody.kt

     * limitations under the License.
     */
    package okhttp3
    
    import okio.BufferedSource
    
    open class ForwardingResponseBody(delegate: ResponseBody?) : ResponseBody() {
      private val delegate: ResponseBody
    
      fun delegate(): ResponseBody {
        return delegate
      }
    
      override fun contentType(): MediaType? {
        return delegate.contentType()
      }
    
      override fun contentLength(): Long {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.2K bytes
    - Viewed (0)
Back to top