public final class HttpRequestBodyMultipartBuilder extends Object
HttpRequestBodyMultipart request.public HttpRequestBodyMultipartBuilder withBoundaries(String boundaries)
boundaries - New boundariespublic HttpRequestBodyMultipartBuilder addFormDataPart(HttpRequestBody body, String name)
"form-data" part. Instead of a "simple" part, a Content-Disposition header
will be automatically added with this part, such as: Content-Disposition: form-data; name="<name>".body - Part body.name - The name attribute of COntent-Disposition header.public HttpRequestBodyMultipartBuilder addFormDataPart(HttpRequestBody body, String name, String filename)
"form-data" part. Instead of a "simple" part, a Content-Disposition header
will be automatically added with this part, such as: Content-Disposition: form-data; name="<name>".body - Part body.name - The name attribute of COntent-Disposition header.public HttpRequestBodyMultipartBuilder addFormDataPart(String name, String value)
"form-data" part. Instead of a "simple" part, a Content-Disposition header
will be automatically added with this part, such as: Content-Disposition: form-data; name="<name>".name - The name attribute of COntent-Disposition header.value - Part raw value.public HttpRequestBodyMultipartBuilder addFormDataPart(File file, String name)
"form-data" part. Instead of a "simple" part, a Content-Disposition header
will be automatically added with this part, such as: Content-Disposition: form-data; name="<name>"; filename="<filename>".
The name of the file in parameter will be automatically used as the filename attribute of Content-Disposition header.file - The file being sent.name - The name attribute of COntent-Disposition header.public HttpRequestBodyMultipartBuilder addFormDataPart(File file, String name, String filename)
"form-data" part. Instead of a "simple" part, a Content-Disposition header
will be automatically added with this part, such as: Content-Disposition: form-data; name="<name>"; filename="<filename>".file - The file being sent.name - The name attribute of COntent-Disposition header.filename - The filename attribute COntent-Disposition header.public HttpRequestBodyMultipartBuilder addFormDataPart(Path path, String name)
"form-data" part. Instead of a "simple" part, a Content-Disposition header
will be automatically added with this part, such as: Content-Disposition: form-data; name="<name>"; filename="<filename>".path - The file being sent.name - The name attribute of COntent-Disposition header.public HttpRequestBodyMultipartBuilder addFormDataPart(Path path, String name, String filename)
"form-data" part. Instead of a "simple" part, a Content-Disposition header
will be automatically added with this part, such as: Content-Disposition: form-data; name="<name>"; filename="<filename>".path - The file being sent.name - The name attribute of COntent-Disposition header.filename - The filename attribute COntent-Disposition header.public HttpRequestBodyMultipartBuilder addPart(HttpRequestBodyPart part)
part - Part to add.public HttpRequestBodyMultipartBuilder asMultipartFormData()
"multipart/form-data".public HttpRequestBodyMultipartBuilder asMultipartMixed()
"multipart/mixed".public HttpRequestBodyMultipartBuilder asMultipartAlternative()
"multipart/alternative".public HttpRequestBodyMultipartBuilder asMultipartDigest()
"multipart/digest".public HttpRequestBodyMultipartBuilder asMultipartParallel()
public HttpRequestBody build()
Copyright © 2019. All rights reserved.