Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 25 for MediaType (0.05 sec)

  1. guava/src/com/google/common/net/MediaType.java

        MediaType mediaType = addKnownType(new MediaType(type, subtype, UTF_8_CONSTANT_PARAMETERS));
        mediaType.parsedCharset = Optional.of(UTF_8);
        return mediaType;
      }
    
      @CanIgnoreReturnValue
      private static MediaType addKnownType(MediaType mediaType) {
        knownTypes.put(mediaType, mediaType);
        return mediaType;
      }
    
      /*
       * The following constants are grouped by their type and ordered alphabetically by the constant
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue May 13 17:27:14 UTC 2025
    - 48K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/net/MediaType.java

        MediaType mediaType = addKnownType(new MediaType(type, subtype, UTF_8_CONSTANT_PARAMETERS));
        mediaType.parsedCharset = Optional.of(UTF_8);
        return mediaType;
      }
    
      @CanIgnoreReturnValue
      private static MediaType addKnownType(MediaType mediaType) {
        knownTypes.put(mediaType, mediaType);
        return mediaType;
      }
    
      /*
       * The following constants are grouped by their type and ordered alphabetically by the constant
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue May 13 17:27:14 UTC 2025
    - 48K bytes
    - Viewed (0)
  3. okhttp/src/jvmTest/kotlin/okhttp3/KotlinDeprecationErrorTest.kt

        val keyPair: KeyPair = heldCertificate.keyPair()
      }
    
      @Test @Disabled
      fun mediaType() {
        val mediaType: MediaType = MediaType.get("")
        val type: String = mediaType.type()
        val subtype: String = mediaType.subtype()
        val parse: MediaType? = MediaType.parse("")
      }
    
      @Test @Disabled
      fun mockResponse() {
        val mockResponse = MockResponse()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Dec 27 13:39:56 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  4. okhttp/src/jvmTest/kotlin/okhttp3/KotlinSourceModernTest.kt

      }
    
      @Test
      fun mediaType() {
        val mediaType: MediaType = "".toMediaType()
        val defaultCharset: Charset? = mediaType.charset()
        val charset: Charset? = mediaType.charset(Charsets.UTF_8)
        val type: String = mediaType.type
        val subtype: String = mediaType.subtype
        val parse: MediaType? = "".toMediaTypeOrNull()
      }
    
      @Test
      fun mockResponse() {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Jun 21 20:36:35 UTC 2025
    - 46.5K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/net/MediaTypeTest.java

            MediaType.parse("text/plain; a=1; a=2").withParameter("a", "3"));
        assertEquals(
            MediaType.parse("text/plain; a=1; a=2; b=3"),
            MediaType.parse("text/plain; a=1; a=2").withParameter("b", "3"));
      }
    
      public void testWithParameter_invalidAttribute() {
        MediaType mediaType = MediaType.parse("text/plain");
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 20.4K bytes
    - Viewed (0)
  6. okhttp/src/commonJvmAndroid/kotlin/okhttp3/ResponseBody.kt

        @JvmName("create")
        fun ByteArray.toResponseBody(contentType: MediaType? = null): ResponseBody =
          Buffer()
            .write(this)
            .asResponseBody(contentType, size.toLong())
    
        /** Returns a new response body that transmits this byte string. */
        @JvmStatic
        @JvmName("create")
        fun ByteString.toResponseBody(contentType: MediaType? = null): ResponseBody =
          Buffer()
            .write(this)
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Tue May 27 14:51:25 UTC 2025
    - 11.6K bytes
    - Viewed (0)
  7. 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 Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 16 09:39:51 UTC 2025
    - 19K bytes
    - Viewed (0)
  8. okhttp/src/jvmTest/kotlin/okhttp3/ResponseBodyJvmTest.kt

      companion object {
        @JvmOverloads
        fun body(
          hex: String,
          charset: String? = null,
        ): ResponseBody {
          val mediaType = if (charset == null) null else "any/thing; charset=$charset".toMediaType()
          return hex.decodeHex().toResponseBody(mediaType)
        }
    
        fun exhaust(reader: Reader): String {
          val builder = StringBuilder()
          val buf = CharArray(10)
          var read: Int
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 12.4K bytes
    - Viewed (0)
  9. okhttp/src/commonJvmAndroid/kotlin/okhttp3/MultipartBody.kt

     */
    @Suppress("NAME_SHADOWING")
    class MultipartBody internal constructor(
      private val boundaryByteString: ByteString,
      @get:JvmName("type") val type: MediaType,
      @get:JvmName("parts") val parts: List<Part>,
    ) : RequestBody() {
      private val contentType: MediaType = "$type; boundary=$boundary".toMediaType()
      private var contentLength = -1L
    
      @get:JvmName("boundary")
      val boundary: String
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 10.9K bytes
    - Viewed (0)
  10. docs/recipes.md

    === ":material-language-java: Java"
        ```java
          public static final MediaType MEDIA_TYPE_MARKDOWN
              = MediaType.parse("text/x-markdown; charset=utf-8");
    
          private final OkHttpClient client = new OkHttpClient();
    
          public void run() throws Exception {
            RequestBody requestBody = new RequestBody() {
              @Override public MediaType contentType() {
                return MEDIA_TYPE_MARKDOWN;
              }
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 17:01:12 UTC 2025
    - 47.8K bytes
    - Viewed (0)
Back to top