Package org.apache.juneau.http.entity
Class MultipartBody.Builder
java.lang.Object
org.apache.juneau.http.entity.MultipartBody.Builder
- Enclosing class:
- MultipartBody
Fluent builder for
MultipartBody.- Since:
- 9.2.1
-
Method Summary
Modifier and TypeMethodDescriptionSets a custom multipart boundary string (defaults to a random UUID-derived value).build()Builds and returns theMultipartBody.Adds a plain-text form field.Adds a file upload part.Adds a custom part.
-
Method Details
-
boundary
Sets a custom multipart boundary string (defaults to a random UUID-derived value).- Parameters:
value- The boundary. Must not benull or blank.- Returns:
- This object.
-
field
Adds a plain-text form field.- Parameters:
name- The field name. Must not benull .value- The field value. Must not benull .- Returns:
- This object.
-
file
Adds a file upload part.- Parameters:
name- The field name. Must not benull .file- The file to upload. Must not benull .contentType- The MIME content type for the file. May benull .- Returns:
- This object.
-
part
Adds a custom part.- Parameters:
part- The part to add. Must not benull .- Returns:
- This object.
-
build
Builds and returns theMultipartBody.- Returns:
- A new instance. Never
null .
-