| Modifier and Type | Field | Description |
|---|---|---|
static MediaType |
MultipartBody.ALTERNATIVE |
The "multipart/alternative" type is syntactically identical to "multipart/mixed", but the
semantics are different.
|
static MediaType |
MultipartBody.DIGEST |
This type is syntactically identical to "multipart/mixed", but the semantics are different.
|
static MediaType |
MultipartBody.FORM |
The media-type multipart/form-data follows the rules of all multipart MIME data streams as
outlined in RFC 2046.
|
static MediaType |
MultipartBody.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 |
MultipartBody.PARALLEL |
This type is syntactically identical to "multipart/mixed", but the semantics are different.
|
| Modifier and Type | Method | Description |
|---|---|---|
MediaType |
FormBody.contentType() |
|
MediaType |
MultipartBody.contentType() |
A combination of
MultipartBody.type() and MultipartBody.boundary(). |
abstract MediaType |
RequestBody.contentType() |
Returns the Content-Type header for this body.
|
abstract MediaType |
ResponseBody.contentType() |
|
static MediaType |
MediaType.get(String string) |
Returns a media type for
string. |
static MediaType |
MediaType.parse(String string) |
Returns a media type for
string, or null if string is not a well-formed media
type. |
MediaType |
MultipartBody.type() |
| Modifier and Type | Method | Description |
|---|---|---|
static RequestBody |
RequestBody.create(MediaType contentType,
byte[] content) |
Returns a new request body that transmits
content. |
static RequestBody |
RequestBody.create(MediaType contentType,
byte[] content,
int offset,
int byteCount) |
Returns a new request body that transmits
content. |
static RequestBody |
RequestBody.create(MediaType contentType,
File file) |
Returns a new request body that transmits the content of
file. |
static RequestBody |
RequestBody.create(MediaType contentType,
String content) |
Returns a new request body that transmits
content. |
static RequestBody |
RequestBody.create(MediaType contentType,
okio.ByteString content) |
Returns a new request body that transmits
content. |
static ResponseBody |
ResponseBody.create(MediaType contentType,
byte[] content) |
Returns a new response body that transmits
content. |
static ResponseBody |
ResponseBody.create(MediaType contentType,
long contentLength,
okio.BufferedSource content) |
Returns a new response body that transmits
content. |
static ResponseBody |
ResponseBody.create(MediaType contentType,
String content) |
Returns a new response body that transmits
content. |
static ResponseBody |
ResponseBody.create(MediaType contentType,
okio.ByteString content) |
Returns a new response body that transmits
content. |
MultipartBody.Builder |
MultipartBody.Builder.setType(MediaType type) |
Set the MIME type.
|
Copyright © 2020. All rights reserved.