- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 162 for contentType (0.06 sec)
-
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) -
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) -
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) -
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) -
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) -
src/test/java/org/codelibs/fess/it/ITBase.java
Registered: 2025-05-26 08:04 - Last Modified: 2025-03-15 06:53 - 3.3K bytes - Viewed (0) -
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) -
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) -
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) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/MultipartBody.kt
Registered: 2025-05-30 11:42 - Last Modified: 2025-03-19 19:25 - 10.9K bytes - Viewed (0)