Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 53 for ResponseBody (0.21 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. 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)
  3. 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)
  4. 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)
  5. 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)
  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/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)
  8. samples/simple-client/src/main/java/okhttp3/sample/OkHttpContributors.java

    import com.squareup.moshi.Moshi;
    import com.squareup.moshi.Types;
    import java.util.Collections;
    import java.util.List;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    import okhttp3.ResponseBody;
    
    public class OkHttpContributors {
      private static final String ENDPOINT = "https://api.github.com/repos/square/okhttp/contributors";
      private static final Moshi MOSHI = new Moshi.Builder().build();
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Fri Apr 05 03:30:42 GMT 2024
    - 2.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/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)
Back to top