public final class MultipartBody extends RequestBody
| 限定符和类型 | 类和说明 |
|---|---|
static class |
MultipartBody.Builder |
static class |
MultipartBody.Part |
| 限定符和类型 | 字段和说明 |
|---|---|
static MediaType |
ALTERNATIVE
The "multipart/alternative" type is syntactically identical to "multipart/mixed", but the
semantics are different.
|
static MediaType |
DIGEST
This type is syntactically identical to "multipart/mixed", but the semantics are different.
|
static MediaType |
FORM
The media-type multipart/form-data follows the rules of all multipart MIME data streams as
outlined in RFC 2046.
|
static MediaType |
MIXED
The "mixed" subtype of "multipart" is intended for use when the body parts are independent and
need to be bundled in a particular order.
|
static MediaType |
PARALLEL
This type is syntactically identical to "multipart/mixed", but the semantics are different.
|
| 限定符和类型 | 方法和说明 |
|---|---|
String |
boundary() |
long |
contentLength()
Returns the number of bytes that will be written to
sink in a call to RequestBody.writeTo(com.lark.oapi.okio.BufferedSink),
or -1 if that count is unknown. |
MediaType |
contentType()
A combination of
type() and boundary(). |
MultipartBody.Part |
part(int index) |
List<MultipartBody.Part> |
parts() |
int |
size()
The number of parts in this multipart body.
|
MediaType |
type() |
void |
writeTo(BufferedSink sink)
Writes the content of this request to
sink. |
public static final MediaType MIXED
public static final MediaType ALTERNATIVE
public static final MediaType DIGEST
Content-Type value for a body part is changed from
"text/plain" to "message/rfc822".public static final MediaType PARALLEL
public static final MediaType FORM
public MediaType type()
public String boundary()
public int size()
public List<MultipartBody.Part> parts()
public MultipartBody.Part part(int index)
public MediaType contentType()
type() and boundary().contentType 在类中 RequestBodypublic long contentLength()
throws IOException
RequestBodysink in a call to RequestBody.writeTo(com.lark.oapi.okio.BufferedSink),
or -1 if that count is unknown.contentLength 在类中 RequestBodyIOExceptionpublic void writeTo(BufferedSink sink) throws IOException
RequestBodysink.writeTo 在类中 RequestBodyIOExceptionCopyright © 2022. All rights reserved.