Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for setType (0.26 sec)

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

          |... contents of file2.gif ...
          |--BbC04y--
          |
          |--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(
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.4K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/MultipartReaderTest.kt

        }
      }
    
      /** 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")
            .addFormDataPart("animal", "fox.txt", "Fox".toRequestBody())
            .build()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13.8K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/MultipartBody.kt

          /**
           * Set the MIME type. Expected values for `type` are [MIXED] (the default), [ALTERNATIVE],
           * [DIGEST], [PARALLEL] and [FORM].
           */
          fun setType(type: MediaType) =
            apply {
              require(type.type == "multipart") { "multipart != $type" }
              this.type = type
            }
    
          /** Add a part to the body. */
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.9K bytes
    - Viewed (0)
  4. samples/guide/src/main/java/okhttp3/recipes/kt/PostMultipart.kt

      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),
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/KotlinSourceModernTest.kt

      @Test
      fun multipartBodyBuilder() {
        val requestBody = "".toRequestBody(null)
        var builder: MultipartBody.Builder = MultipartBody.Builder()
        builder = MultipartBody.Builder("")
        builder = builder.setType("".toMediaType())
        builder = builder.addPart(requestBody)
        builder = builder.addPart(headersOf(), requestBody)
        builder = builder.addPart(null, requestBody)
        builder = builder.addFormDataPart("", "")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 01 14:21:25 GMT 2024
    - 46.5K bytes
    - Viewed (4)
  6. okhttp/api/okhttp.api

    	public final fun addPart (Lokhttp3/RequestBody;)Lokhttp3/MultipartBody$Builder;
    	public final fun build ()Lokhttp3/MultipartBody;
    	public final fun setType (Lokhttp3/MediaType;)Lokhttp3/MultipartBody$Builder;
    }
    
    public final class okhttp3/MultipartBody$Companion {
    }
    
    public final class okhttp3/MultipartBody$Part {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 15 13:41:01 GMT 2024
    - 70.2K bytes
    - Viewed (0)
Back to top