public class MultipartBody extends FormBody<MultipartBody>
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getContentType()
获取Multipart的Content-Type类型
|
String |
getContentType(Charset charset)
获取指定编码的Content-Type,类似于:application/json;charset=UTF-8
如果 HttpBody.getContentType() 已经包含编码信息,则编码信息一致直接返回,否则替换为指定编码。 |
static MultipartBody |
of(Map<String,Object> form,
Charset charset)
根据已有表单内容,构建MultipartBody,使用全局默认的边界符
HttpGlobalConfig.getBoundary() |
static MultipartBody |
of(Map<String,Object> form,
Charset charset,
String boundary)
根据已有表单内容,构建MultipartBody
|
String |
toString() |
void |
write(OutputStream out)
写出Multiparty数据,不关闭流
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetBytes, getStream, writeClosepublic static MultipartBody of(Map<String,Object> form, Charset charset)
HttpGlobalConfig.getBoundary()form - 表单charset - 编码public static MultipartBody of(Map<String,Object> form, Charset charset, String boundary)
form - 表单charset - 编码boundary - Multipart边界符public String getContentType()
public String getContentType(Charset charset)
HttpBodyHttpBody.getContentType() 已经包含编码信息,则编码信息一致直接返回,否则替换为指定编码。charset - 编码HttpBody.getContentType()public void write(OutputStream out)
out - out流Copyright © 2024. All rights reserved.