Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 75 for mediaType (0.04 sec)

  1. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/UnreadableResponseBody.kt

     */
    package okhttp3.internal
    
    import okhttp3.MediaType
    import okhttp3.Response
    import okhttp3.ResponseBody
    import okio.Buffer
    import okio.Source
    import okio.Timeout
    import okio.buffer
    
    internal class UnreadableResponseBody(
      private val mediaType: MediaType?,
      private val contentLength: Long,
    ) : ResponseBody(),
      Source {
      override fun contentType() = mediaType
    
      override fun contentLength() = contentLength
    
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Tue May 27 15:19:53 UTC 2025
    - 1.7K bytes
    - Viewed (0)
  2. samples/guide/src/main/java/okhttp3/recipes/PostStreamingWithPipe.java

    package okhttp3.recipes;
    
    import java.io.IOException;
    import okhttp3.MediaType;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.RequestBody;
    import okhttp3.Response;
    import okio.BufferedSink;
    import okio.Okio;
    import okio.Pipe;
    
    public final class PostStreamingWithPipe {
      public static final MediaType MEDIA_TYPE_MARKDOWN
          = MediaType.get("text/x-markdown; charset=utf-8");
    
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Fri Jul 06 03:18:15 UTC 2018
    - 3.1K bytes
    - Viewed (0)
  3. samples/crawler/src/main/java/okhttp3/sample/Crawler.java

          String contentType = response.header("Content-Type");
          if (responseCode != 200 || contentType == null) {
            return;
          }
    
          MediaType mediaType = MediaType.parse(contentType);
          if (mediaType == null || !mediaType.subtype().equalsIgnoreCase("html")) {
            return;
          }
    
          Document document = Jsoup.parse(response.body().string(), url.toString());
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Wed Jul 23 00:58:06 UTC 2025
    - 5K bytes
    - Viewed (0)
  4. okhttp/src/commonJvmAndroid/kotlin/okhttp3/FormBody.kt

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    package okhttp3
    
    import java.io.IOException
    import java.nio.charset.Charset
    import okhttp3.MediaType.Companion.toMediaType
    import okhttp3.internal.toImmutableList
    import okhttp3.internal.url.FORM_ENCODE_SET
    import okhttp3.internal.url.canonicalizeWithCharset
    import okhttp3.internal.url.percentDecode
    import okio.Buffer
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 4.3K bytes
    - Viewed (0)
  5. samples/guide/src/main/java/okhttp3/recipes/PostString.java

     */
    package okhttp3.recipes;
    
    import java.io.IOException;
    import okhttp3.MediaType;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.RequestBody;
    import okhttp3.Response;
    
    public final class PostString {
      public static final MediaType MEDIA_TYPE_MARKDOWN
          = MediaType.get("text/x-markdown; charset=utf-8");
    
      private final OkHttpClient client = new OkHttpClient();
    
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Sat May 25 18:02:55 UTC 2019
    - 1.7K bytes
    - Viewed (0)
  6. samples/guide/src/main/java/okhttp3/recipes/UploadProgress.java

    import java.io.File;
    import java.io.IOException;
    
    public final class UploadProgress {
      private static final String IMGUR_CLIENT_ID = "9199fdef135c122";
      private static final MediaType MEDIA_TYPE_PNG = MediaType.get("image/png");
    
      private final OkHttpClient client = new OkHttpClient();
    
      public void run() throws Exception {
        // Use the imgur image upload API as documented at https://api.imgur.com/endpoints/image
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Sat Aug 30 17:01:12 UTC 2025
    - 4.2K bytes
    - Viewed (1)
  7. okhttp/src/jvmTest/kotlin/okhttp3/CommonRequestBodyTest.kt

    class CommonRequestBodyTest {
      @Test
      fun correctContentType() {
        val body = "Body"
        val requestBody = body.toRequestBody(MediaType("text/plain", "text", "plain", arrayOf()))
    
        val contentType = requestBody.contentType()!!
    
        assertThat(contentType.mediaType).isEqualTo("text/plain; charset=utf-8")
        assertThat(contentType.parameter("charset")).isEqualTo("utf-8")
      }
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Fri Dec 27 13:39:56 UTC 2024
    - 1.1K bytes
    - Viewed (0)
  8. okhttp/src/jvmTest/kotlin/okhttp3/RequestTest.kt

            "}}",
        )
      }
    
      @Test
      fun gzip() {
        val mediaType = "text/plain; charset=utf-8".toMediaType()
        val originalBody = "This is the original message".toRequestBody(mediaType)
        assertThat(originalBody.contentLength()).isEqualTo(28L)
        assertThat(originalBody.contentType()).isEqualTo(mediaType)
    
        val request =
          Request
            .Builder()
            .url("https://square.com/")
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Fri Oct 24 11:36:14 UTC 2025
    - 24.4K bytes
    - Viewed (0)
  9. okhttp-testing-support/src/main/kotlin/okhttp3/ForwardingRequestBody.kt

    import okio.BufferedSink
    
    open class ForwardingRequestBody(
      delegate: RequestBody?,
    ) : RequestBody() {
      private val delegate: RequestBody
    
      fun delegate(): RequestBody = delegate
    
      override fun contentType(): MediaType? = delegate.contentType()
    
      @Throws(IOException::class)
      override fun contentLength(): Long = delegate.contentLength()
    
      @Throws(IOException::class)
      override fun writeTo(sink: BufferedSink) {
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 1.3K bytes
    - Viewed (0)
  10. okhttp-testing-support/src/main/kotlin/okhttp3/internal/duplex/AsyncRequestBody.kt

     */
    package okhttp3.internal.duplex
    
    import java.util.concurrent.BlockingQueue
    import java.util.concurrent.LinkedBlockingQueue
    import java.util.concurrent.TimeUnit.SECONDS
    import okhttp3.MediaType
    import okhttp3.RequestBody
    import okio.BufferedSink
    import org.junit.jupiter.api.Assertions.assertTrue
    
    /** A duplex request body that keeps the provided sinks so they can be written to later.  */
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 1.5K bytes
    - Viewed (0)
Back to top