Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 162 for contentType (0.06 sec)

  1. okhttp/src/commonJvmAndroid/kotlin/okhttp3/ResponseBody.kt

          val buffer = Buffer().writeString(this, charset)
          return buffer.asResponseBody(finalContentType, buffer.size)
        }
    
        /** Returns a new response body that transmits this byte array. */
        @JvmStatic
        @JvmName("create")
        fun ByteArray.toResponseBody(contentType: MediaType? = null): ResponseBody =
          Buffer()
            .write(this)
    Registered: 2025-05-30 11:42
    - Last Modified: 2025-05-27 14:51
    - 11.6K bytes
    - Viewed (0)
  2. okhttp/src/commonJvmAndroid/kotlin/okhttp3/RequestBody.kt

        /**
         * Returns a new request body that transmits this string. If [contentType] is non-null and lacks
         * a charset, this will use UTF-8.
         */
        @JvmStatic
        @JvmName("create")
        fun String.toRequestBody(contentType: MediaType? = null): RequestBody {
          val (charset, finalContentType) = contentType.chooseCharset()
          val bytes = toByteArray(charset)
    Registered: 2025-05-30 11:42
    - Last Modified: 2025-05-27 14:51
    - 9.9K bytes
    - Viewed (0)
  3. okhttp/src/jvmTest/kotlin/okhttp3/RequestTest.kt

        val contentType = "text/plain; charset=utf-16be".toMediaType()
        val body = "\u0800".toRequestBody(contentType)
        assertThat(body.contentType()).isEqualTo(contentType)
        assertThat(body.contentLength()).isEqualTo(2)
        assertThat(bodyToHex(body)).isEqualTo("0800")
      }
    
      @Test
      fun byteArray() {
        val contentType = "text/plain".toMediaType()
        val body: RequestBody = "abc".toByteArray().toRequestBody(contentType)
    Registered: 2025-05-30 11:42
    - Last Modified: 2025-03-19 19:25
    - 16.8K bytes
    - Viewed (0)
  4. src/test/java/org/codelibs/core/net/MimeTypeUtilTest.java

            final String contentType = MimeTypeUtil.guessContentType(path);
            assertEquals("text/html", contentType);
        }
    
        /**
         * @throws Exception
         */
        @Test
        public void testGetFromStream_gif() throws Exception {
            final String path = ClassUtil.getPackageName(this.getClass()).replaceAll("\\.", "/") + "/ccc.gif";
            final String contentType = MimeTypeUtil.guessContentType(path);
    Registered: 2025-05-24 08:58
    - Last Modified: 2025-05-10 01:32
    - 2.7K bytes
    - Viewed (0)
  5. src/main/java/org/codelibs/fess/helper/OsddHelper.java

            this.osddPath = osddPath;
        }
    
        public void setEncoding(final String encoding) {
            this.encoding = encoding;
        }
    
        public void setContentType(final String contentType) {
            this.contentType = contentType;
        }
    Registered: 2025-05-26 08:04
    - Last Modified: 2025-03-15 06:53
    - 3.7K bytes
    - Viewed (0)
  6. src/test/java/org/codelibs/fess/it/ITBase.java

            if (testToken != null) {
                return;
            }
            given().contentType("application/json").delete(getEsUrl() + "/fess_config.access_token/_doc/" + DEFAULT_TEST_TOKEN_ID);
        }
    
        public static void refresh() {
            given().contentType("application/json").post(getEsUrl() + "/_refresh");
        }
    
        public static String getFessUrl() {
    Registered: 2025-05-26 08:04
    - Last Modified: 2025-03-15 06:53
    - 3.3K bytes
    - Viewed (0)
  7. okhttp/src/jvmTest/kotlin/okhttp3/CommonRequestBodyTest.kt

      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: 2025-05-30 11:42
    - Last Modified: 2024-12-27 13:39
    - 1.1K bytes
    - Viewed (0)
  8. okhttp-logging-interceptor/src/main/kotlin/okhttp3/logging/HttpLoggingInterceptor.kt

            !contentEncoding.equals("gzip", ignoreCase = true)
        }
    
        private fun bodyIsStreaming(response: Response): Boolean {
          val contentType = response.body.contentType()
          return contentType != null && contentType.type == "text" && contentType.subtype == "event-stream"
        }
    
        companion object
    Registered: 2025-05-30 11:42
    - Last Modified: 2025-05-10 11:15
    - 11.2K bytes
    - Viewed (0)
  9. okhttp/src/jvmTest/kotlin/okhttp3/RequestBodyTest.kt

          val requestBody = fd.toRequestBody()
    
          assertThat(requestBody.contentType()).isNull()
        }
      }
    
      @Test
      fun testFileDescriptorMediaType() {
        assertOnFileDescriptor { fd ->
          val contentType = "text/plain".toMediaType()
    
          val requestBody = fd.toRequestBody(contentType)
    
          assertThat(requestBody.contentType()).isEqualTo(contentType)
        }
      }
    
      @Test
      fun testFileDescriptorReadTwice() {
    Registered: 2025-05-30 11:42
    - Last Modified: 2025-03-19 19:25
    - 3.6K bytes
    - Viewed (0)
  10. okhttp/src/commonJvmAndroid/kotlin/okhttp3/MultipartBody.kt

                .write(COLONSPACE)
                .writeUtf8(headers.value(h))
                .write(CRLF)
            }
          }
    
          val contentType = body.contentType()
          if (contentType != null) {
            sink
              .writeUtf8("Content-Type: ")
              .writeUtf8(contentType.toString())
              .write(CRLF)
          }
    
          // We can't measure the body's size without the sizes of its components.
    Registered: 2025-05-30 11:42
    - Last Modified: 2025-03-19 19:25
    - 10.9K bytes
    - Viewed (0)
Back to top