- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 13 for multipartBody (0.36 sec)
-
okhttp/src/main/kotlin/okhttp3/MultipartBody.kt
apply { parts += part } /** Assemble the specified parts into a request body. */ fun build(): MultipartBody { check(parts.isNotEmpty()) { "Multipart body must have at least one part." } return MultipartBody(boundary, type, parts.toImmutableList()) } } companion object { /**
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 10.9K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/MultipartBodyTest.kt
| |--AaB03x-- | """.trimMargin().replace("\n", "\r\n") val body = MultipartBody.Builder("AaB03x") .setType(MultipartBody.FORM) .addFormDataPart("submit-name", "Larry") .addFormDataPart( "files", null, MultipartBody.Builder("BbC04y") .addPart( headersOf("Content-Disposition", "file; filename=\"file1.txt\""),
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 10.4K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/KotlinSourceModernTest.kt
mockWebServer.close() } @Test fun multipartBody() { val multipartBody: MultipartBody = MultipartBody.Builder().build() val type: MediaType = multipartBody.type val boundary: String = multipartBody.boundary val size: Int = multipartBody.size val parts: List<MultipartBody.Part> = multipartBody.parts val part: MultipartBody.Part = multipartBody.part(0)
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Apr 01 14:21:25 UTC 2024 - 46.5K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/PostMultipart.java
public void run() throws Exception { // Use the imgur image upload API as documented at https://api.imgur.com/endpoints/image RequestBody requestBody = new MultipartBody.Builder() .setType(MultipartBody.FORM) .addFormDataPart("title", "Square Logo") .addFormDataPart("image", "logo-square.png", RequestBody.create( new File("docs/images/logo-square.png"),
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jun 24 12:59:42 UTC 2019 - 2.2K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/KotlinDeprecationErrorTest.kt
} @Test @Disabled fun multipartBody() { val multipartBody: MultipartBody = MultipartBody.Builder().build() val type: MediaType = multipartBody.type() val boundary: String = multipartBody.boundary() val size: Int = multipartBody.size() val parts: List<MultipartBody.Part> = multipartBody.parts() } @Test @Disabled fun multipartBodyPart() {
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 13.3K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/kt/PostMultipart.kt
import okhttp3.MediaType.Companion.toMediaType import okhttp3.MultipartBody import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.RequestBody.Companion.asRequestBody class PostMultipart { private val client = OkHttpClient() fun run() { // Use the imgur image upload API as documented at https://api.imgur.com/endpoints/image val requestBody = MultipartBody.Builder() .setType(MultipartBody.FORM)
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 2.1K bytes - Viewed (0) -
okhttp/api/okhttp.api
public final fun addFormDataPart (Ljava/lang/String;Ljava/lang/String;Lokhttp3/RequestBody;)Lokhttp3/MultipartBody$Builder; public final fun addPart (Lokhttp3/Headers;Lokhttp3/RequestBody;)Lokhttp3/MultipartBody$Builder; public final fun addPart (Lokhttp3/MultipartBody$Part;)Lokhttp3/MultipartBody$Builder;
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Apr 15 13:41:01 UTC 2024 - 70.2K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/MultipartReaderTest.kt
) assertFailsWith<EOFException> { parts.nextPart() } } /** Confirm that [MultipartBody] and [MultipartReader] can work together. */ @Test fun `multipart round trip`() { val body = MultipartBody.Builder("boundary") .setType(MultipartBody.PARALLEL) .addPart("Quick".toRequestBody("text/plain".toMediaType())) .addFormDataPart("color", "Brown")
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 13.8K bytes - Viewed (0) -
docs/changelogs/upgrading_to_okhttp_4.md
* **MockResponse**: headers, http2ErrorCode, socketPolicy, status, trailers * **MockWebServer**: bodyLimit, port, protocolNegotiationEnabled, protocols, requestCount, serverSocketFactory * **MultipartBody.Part**: body, headers * **MultipartBody.**: boundary, parts, size, type * **OkHttpClient**: authenticator, cache, callTimeoutMillis, certificatePinner, connectTimeoutMillis, connectionPool, connectionSpecs, cookieJar, dispatcher, dns,
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sun Feb 06 16:58:16 UTC 2022 - 10.9K bytes - Viewed (0) -
docs/recipes.md
private val client = OkHttpClient() fun run() { // Use the imgur image upload API as documented at https://api.imgur.com/endpoints/image val requestBody = MultipartBody.Builder() .setType(MultipartBody.FORM) .addFormDataPart("title", "Square Logo") .addFormDataPart("image", "logo-square.png", File("docs/images/logo-square.png").asRequestBody(MEDIA_TYPE_PNG))
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Fri Feb 18 08:52:22 UTC 2022 - 40.2K bytes - Viewed (0)