Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for addFormDataPart (0.22 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()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.4K bytes
    - Viewed (0)
  2. samples/guide/src/main/java/okhttp3/recipes/PostMultipart.java

        // 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"),
                    MEDIA_TYPE_PNG))
            .build();
    
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jun 24 12:59:42 GMT 2019
    - 2.2K bytes
    - Viewed (0)
  3. 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 =
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  4. 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")
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13.8K bytes
    - Viewed (0)
  5. 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 {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.9K bytes
    - Viewed (0)
  6. docs/recipes.md

            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 = Request.Builder()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Fri Feb 18 08:52:22 GMT 2022
    - 40.2K bytes
    - Viewed (1)
  7. 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()
      }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Apr 01 14:21:25 GMT 2024
    - 46.5K bytes
    - Viewed (4)
  8. 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;
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Apr 15 13:41:01 GMT 2024
    - 70.2K bytes
    - Viewed (0)
Back to top