org.apache.http.entity.mime

## Class MultipartEntityBuilder

- java.lang.Object
- - org.apache.http.entity.mime.MultipartEntityBuilder

-     public class MultipartEntityBuilder
      extends Object

  Builder for multipart `HttpEntity`s.
  Since:
    4.3

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `MultipartEntityBuilder` | `addBinaryBody(String name, byte[] b)`
    `MultipartEntityBuilder` | `addBinaryBody(String name, byte[] b, org.apache.http.entity.ContentType contentType, String filename)`
    `MultipartEntityBuilder` | `addBinaryBody(String name, File file)`
    `MultipartEntityBuilder` | `addBinaryBody(String name, File file, org.apache.http.entity.ContentType contentType, String filename)`
    `MultipartEntityBuilder` | `addBinaryBody(String name, InputStream stream)`
    `MultipartEntityBuilder` | `addBinaryBody(String name, InputStream stream, org.apache.http.entity.ContentType contentType, String filename)`
    `MultipartEntityBuilder` | `addPart(FormBodyPart bodyPart)`
    `MultipartEntityBuilder` | `addPart(String name, ContentBody contentBody)`
    `MultipartEntityBuilder` | `addTextBody(String name, String text)`
    `MultipartEntityBuilder` | `addTextBody(String name, String text, org.apache.http.entity.ContentType contentType)`
    `org.apache.http.HttpEntity` | `build()`
    `static MultipartEntityBuilder` | `create()`
    `MultipartEntityBuilder` | `seContentType(org.apache.http.entity.ContentType contentType)` Deprecated. (4.5) Use `setContentType(org.apache.http.entity.ContentType)`.
    `MultipartEntityBuilder` | `setBoundary(String boundary)`
    `MultipartEntityBuilder` | `setCharset(Charset charset)`
    `MultipartEntityBuilder` | `setContentType(org.apache.http.entity.ContentType contentType)`
    `MultipartEntityBuilder` | `setLaxMode()`
    `MultipartEntityBuilder` | `setMimeSubtype(String subType)`
    `MultipartEntityBuilder` | `setMode(HttpMultipartMode mode)`
    `MultipartEntityBuilder` | `setStrictMode()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### create

          public static MultipartEntityBuilder create()

    - #### setMode

          public MultipartEntityBuilder setMode(HttpMultipartMode mode)

    - #### setLaxMode

          public MultipartEntityBuilder setLaxMode()

    - #### setStrictMode

          public MultipartEntityBuilder setStrictMode()

    - #### setBoundary

          public MultipartEntityBuilder setBoundary(String boundary)

    - #### setMimeSubtype

          public MultipartEntityBuilder setMimeSubtype(String subType)

      Since:
        4.4

    - #### seContentType

          @Deprecated
          public MultipartEntityBuilder seContentType(org.apache.http.entity.ContentType contentType)

      Deprecated. (4.5) Use `setContentType(org.apache.http.entity.ContentType)`.
      Since:
        4.4

    - #### setContentType

          public MultipartEntityBuilder setContentType(org.apache.http.entity.ContentType contentType)

      Since:
        4.5

    - #### setCharset

          public MultipartEntityBuilder setCharset(Charset charset)

    - #### addPart

          public MultipartEntityBuilder addPart(FormBodyPart bodyPart)

      Since:
        4.4

    - #### addPart

          public MultipartEntityBuilder addPart(String name,
                                       ContentBody contentBody)

    - #### addTextBody

          public MultipartEntityBuilder addTextBody(String name,
                                           String text,
                                           org.apache.http.entity.ContentType contentType)

    - #### addTextBody

          public MultipartEntityBuilder addTextBody(String name,
                                           String text)

    - #### addBinaryBody

          public MultipartEntityBuilder addBinaryBody(String name,
                                             byte[] b,
                                             org.apache.http.entity.ContentType contentType,
                                             String filename)

    - #### addBinaryBody

          public MultipartEntityBuilder addBinaryBody(String name,
                                             byte[] b)

    - #### addBinaryBody

          public MultipartEntityBuilder addBinaryBody(String name,
                                             File file,
                                             org.apache.http.entity.ContentType contentType,
                                             String filename)

    - #### addBinaryBody

          public MultipartEntityBuilder addBinaryBody(String name,
                                             File file)

    - #### addBinaryBody

          public MultipartEntityBuilder addBinaryBody(String name,
                                             InputStream stream,
                                             org.apache.http.entity.ContentType contentType,
                                             String filename)

    - #### addBinaryBody

          public MultipartEntityBuilder addBinaryBody(String name,
                                             InputStream stream)

    - #### build

          public org.apache.http.HttpEntity build()

Copyright © 1999–2022 The Apache Software Foundation. All rights reserved.