Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for addFormDataPart (0.18 sec)

  1. okhttp/src/test/java/okhttp3/MultipartBodyTest.kt

            .setType(MultipartBody.FORM)
            .addFormDataPart(
              "field with spaces",
              "filename with spaces.txt",
              "okay".toRequestBody("text/plain; charset=utf-8".toMediaType()),
            )
            .addFormDataPart("field with \"", "\"")
            .addFormDataPart("field with %22", "%22")
            .addFormDataPart("field with \u007e", "Alpha")
            .build()
        val buffer = Buffer()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  2. samples/guide/src/main/java/okhttp3/recipes/kt/PostMultipart.kt

        // 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),
            )
            .build()
    
        val request =
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/MultipartReaderTest.kt

        val body =
          MultipartBody.Builder("boundary")
            .setType(MultipartBody.PARALLEL)
            .addPart("Quick".toRequestBody("text/plain".toMediaType()))
            .addFormDataPart("color", "Brown")
            .addFormDataPart("animal", "fox.txt", "Fox".toRequestBody())
            .build()
    
        val bodyContent = Buffer()
        body.writeTo(bodyContent)
    
        val reader = MultipartReader(bodyContent, "boundary")
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 13.8K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/MultipartBody.kt

          }
    
          /** Add a form data part to the body. */
          fun addFormDataPart(
            name: String,
            value: String,
          ) = apply {
            addPart(Part.createFormData(name, value))
          }
    
          /** Add a form data part to the body. */
          fun addFormDataPart(
            name: String,
            filename: String?,
            body: RequestBody,
          ) = apply {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/KotlinSourceModernTest.kt

        builder = builder.addPart(requestBody)
        builder = builder.addPart(headersOf(), requestBody)
        builder = builder.addPart(null, requestBody)
        builder = builder.addFormDataPart("", "")
        builder = builder.addFormDataPart("", "", requestBody)
        builder = builder.addFormDataPart("", null, requestBody)
        builder = builder.addPart(MultipartBody.Part.create(requestBody))
        val multipartBody: MultipartBody = builder.build()
      }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Apr 01 14:21:25 UTC 2024
    - 46.5K bytes
    - Viewed (0)
  6. okhttp/api/okhttp.api

    	public fun <init> (Ljava/lang/String;)V
    	public synthetic fun <init> (Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
    	public final fun addFormDataPart (Ljava/lang/String;Ljava/lang/String;)Lokhttp3/MultipartBody$Builder;
    	public final fun addFormDataPart (Ljava/lang/String;Ljava/lang/String;Lokhttp3/RequestBody;)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)
Back to top