public static final class MultipartBody.Builder extends Object
MultipartBody| Constructor and Description |
|---|
Builder()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
MultipartBody.Builder |
addPart(Part part)
Appends the specified part into parts
|
MultipartBody.Builder |
addPart(String name,
byte[] data)
Appends the specified name and part entity into parts
|
MultipartBody.Builder |
addPart(String name,
byte[] data,
MimeType contentType)
Appends the specified name and part entity into parts
|
MultipartBody.Builder |
addPart(String name,
File file)
Appends the specified name and part entity into parts
|
MultipartBody.Builder |
addPart(String name,
File file,
MimeType contentType)
Appends the specified name and part entity into parts
|
MultipartBody.Builder |
addPart(String name,
InputStream value)
Appends the specified name and part entity into parts
|
MultipartBody.Builder |
addPart(String name,
PartEntity entity)
Appends the specified name and part entity into parts
|
MultipartBody.Builder |
addPart(String name,
String text)
Appends the specified name and part entity into parts
|
MultipartBody.Builder |
addPart(String name,
String text,
MimeType contentType)
Appends the specified name and part entity into parts
|
MultipartBody |
build()
Instantialize a multipart body
|
String |
getBoundary() |
Charset |
getCharset() |
List<Part> |
getParts() |
MultipartBody.Builder |
setBoundary(String boundary)
Sets the boundary
|
MultipartBody.Builder |
setCharset(Charset charset)
Sets the charset
|
public Charset getCharset()
public String getBoundary()
public MultipartBody.Builder setCharset(Charset charset)
charset - The charsetpublic MultipartBody.Builder setBoundary(String boundary)
boundary - The boundarypublic MultipartBody.Builder addPart(Part part)
part - A partpublic MultipartBody.Builder addPart(String name, PartEntity entity)
name - The name of partentity - The entity of partpublic MultipartBody.Builder addPart(String name, byte[] data)
name - The name of partdata - The data of part entitypublic MultipartBody.Builder addPart(String name, byte[] data, MimeType contentType)
name - The name of partdata - The data of part entitycontentType - The content type of part entitypublic MultipartBody.Builder addPart(String name, File file)
name - The name of partfile - The data of part entitypublic MultipartBody.Builder addPart(String name, File file, MimeType contentType)
name - The name of partfile - The data of part entitycontentType - The content type of part entitypublic MultipartBody.Builder addPart(String name, String text)
name - The name of parttext - The data of part entitypublic MultipartBody.Builder addPart(String name, String text, MimeType contentType)
name - The name of parttext - The data of part entitycontentType - The content type of part entitypublic MultipartBody.Builder addPart(String name, InputStream value)
name - The name of partvalue - The stream of part entitypublic MultipartBody build()
MultipartBodyCopyright © 2015–2017 SDKLite. All rights reserved.