Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 31 for ResponseBody (0.32 sec)

  1. samples/guide/src/main/java/okhttp3/recipes/Progress.java

      }
    
      private static class ProgressResponseBody extends ResponseBody {
    
        private final ResponseBody responseBody;
        private final ProgressListener progressListener;
        private BufferedSource bufferedSource;
    
        ProgressResponseBody(ResponseBody responseBody, ProgressListener progressListener) {
          this.responseBody = responseBody;
          this.progressListener = progressListener;
        }
    
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Jan 12 03:31:36 GMT 2019
    - 3.9K 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/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)
  4. 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)
  5. samples/guide/src/main/java/okhttp3/recipes/AsynchronousGet.java

          @Override public void onFailure(Call call, IOException e) {
            e.printStackTrace();
          }
    
          @Override public void onResponse(Call call, Response response) throws IOException {
            try (ResponseBody responseBody = response.body()) {
              if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
    
              Headers responseHeaders = response.headers();
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun May 22 01:29:42 GMT 2016
    - 1.9K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/ResponseBodyTest.kt

        assertThat(source.exhausted()).isTrue()
        assertThat(source.readUtf8()).isEqualTo("")
      }
    
      @Test
      fun sourceClosesUnderlyingSource() {
        var closed = false
    
        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
    - 4K bytes
    - Viewed (0)
  7. 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)
  8. okhttp/src/test/java/okhttp3/ResponseJvmTest.kt

     */
    package okhttp3
    
    import assertk.assertThat
    import assertk.assertions.isEmpty
    import assertk.assertions.isEqualTo
    import kotlin.test.assertFailsWith
    import okhttp3.ResponseBody.Companion.asResponseBody
    import okhttp3.ResponseBody.Companion.toResponseBody
    import okio.Buffer
    import okio.BufferedSource
    import okio.Source
    import okio.Timeout
    import okio.buffer
    import org.junit.jupiter.api.Test
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.1K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/internal/http/RealResponseBody.kt

    import okhttp3.ResponseBody
    import okio.BufferedSource
    
    class RealResponseBody(
      /**
       * Use a string to avoid parsing the content type until needed. This also defers problems caused
       * by malformed content types.
       */
      private val contentTypeString: String?,
      private val contentLength: Long,
      private val source: BufferedSource,
    ) : ResponseBody() {
    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)
  10. okhttp/src/main/kotlin/okhttp3/internal/http/BridgeInterceptor.kt

        if (transparentGzip &&
          "gzip".equals(networkResponse.header("Content-Encoding"), ignoreCase = true) &&
          networkResponse.promisesBody()
        ) {
          val responseBody = networkResponse.body
          if (responseBody != null) {
            val gzipSource = GzipSource(responseBody.source())
            val strippedHeaders =
              networkResponse.headers.newBuilder()
                .removeAll("Content-Encoding")
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.2K bytes
    - Viewed (2)
Back to top