添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
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
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.
contentLength ()
Returns the number of bytes that will be written to sink in a call to RequestBody.writeTo(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 () size ()
The number of parts in this multipart body.
MediaType type () writeTo (okio.BufferedSink sink)
Writes the content of this request to sink .

MIXED

public static final 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. Any "multipart" subtypes that an implementation does not recognize must be treated as being of subtype "mixed".

ALTERNATIVE

public static final MediaType ALTERNATIVE
The "multipart/alternative" type is syntactically identical to "multipart/mixed", but the semantics are different. In particular, each of the body parts is an "alternative" version of the same information.

DIGEST

public static final MediaType DIGEST
This type is syntactically identical to "multipart/mixed", but the semantics are different. In particular, in a digest, the default Content-Type value for a body part is changed from "text/plain" to "message/rfc822".

PARALLEL

public static final MediaType PARALLEL
This type is syntactically identical to "multipart/mixed", but the semantics are different. In particular, in a parallel entity, the order of body parts is not significant.
public static final MediaType FORM
The media-type multipart/form-data follows the rules of all multipart MIME data streams as outlined in RFC 2046. In forms, there are a series of fields to be supplied by the user who fills out the form. Each field has a name. Within a given form, the names are unique.
throws IOException
Description copied from class: RequestBody
Returns the number of bytes that will be written to sink in a call to RequestBody.writeTo(okio.BufferedSink) , or -1 if that count is unknown.
Overrides:
contentLength in class RequestBody
Throws:
IOException
public void writeTo(okio.BufferedSink sink)
             throws IOException
Description copied from class: RequestBody
Writes the content of this request to sink .
Specified by:
writeTo in class RequestBody
Throws:
IOException