public final class MultipartBody extends RequestBody
| Modifier and Type | Class and Description |
|---|---|
static class |
MultipartBody
|
static class |
MultipartBody
|
| Modifier and Type | Field and Description |
|---|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
String |
boundary()
|
long |
contentLength()
Returns the number of bytes that will be written to
out in a call to
RequestBody, or -1 if that count is unknown.
|
MediaType |
contentType()
A combination of
type() and
boundary().
|
MultipartBody |
part(int index)
|
List |
parts()
|
int |
size()
The number of parts in this multipart body.
|
MediaType |
type()
|
void |
writeTo(okio
Writes the content of this request to
out.
|
public static final MediaTypeMIXED
public static final MediaTypeALTERNATIVE
public static final MediaTypeDIGEST
Content-Type value for a body part is changed from "text/plain" to "message/rfc822".
public static final MediaTypePARALLEL
public static final MediaTypeFORM
public MediaTypetype()
public Stringboundary()
public int size()
public List<MultipartBody .Part > parts()
public MultipartBody.Part part(int index)
public MediaTypecontentType()
type() and
boundary().
public long contentLength()
throws IOException
RequestBody
out in a call to
RequestBody.writeTo(okio.BufferedSink) , or -1 if that count is unknown.
contentLength in class
RequestBody
IOException
public void writeTo(okio.BufferedSink sink) throws IOException
RequestBody
out.
writeTo in class
RequestBody
IOException