Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 24 for mediaType (0.06 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 Dec 26 12:43:10 UTC 2025
    - Last Modified: Thu Oct 02 01:46:40 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 Dec 26 12:43:10 UTC 2025
    - Last Modified: Thu Oct 02 01:46:40 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 Dec 26 11:42:13 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 Dec 26 11:42:13 UTC 2025
    - Last Modified: Wed Nov 05 18:28:35 UTC 2025
    - 47K bytes
    - Viewed (0)
  5. 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 Dec 26 11:42:13 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 12.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 Dec 26 11:42:13 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 Dec 26 11:42:13 UTC 2025
    - Last Modified: Fri Oct 24 11:36:14 UTC 2025
    - 24.4K bytes
    - Viewed (0)
  8. 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 Dec 26 11:42:13 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 10.9K bytes
    - Viewed (0)
  9. 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 Dec 26 11:42:13 UTC 2025
    - Last Modified: Sat Aug 30 17:01:12 UTC 2025
    - 47.8K bytes
    - Viewed (0)
  10. okhttp/src/jvmTest/kotlin/okhttp3/InterceptorTest.kt

            val originalRequest = chain.request()
            val mediaType = "text/plain".toMediaType()
            val body = "abc".toRequestBody(mediaType)
            chain.proceed(
              originalRequest
                .newBuilder()
                .method("POST", body)
                .header("Content-Type", mediaType.toString())
                .header("Content-Length", body.contentLength().toString())
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Tue Nov 04 16:11:23 UTC 2025
    - 28.2K bytes
    - Viewed (0)
Back to top