Modifier and Type | Field and Description |
---|---|
static com.squareup.okhttp.MediaType |
FORM
The media-type multipart/form-data follows the rules of all multipart MIME data streams as
outlined in RFC 2046.
|
Constructor and Description |
---|
MultipartBuilder()
Creates a new multipart builder that uses a random boundary token.
|
MultipartBuilder(String boundary)
Creates a new multipart builder that uses
boundary to separate parts. |
Modifier and Type | Method and Description |
---|---|
MultipartBuilder |
addFormDataPart(String name,
String filename,
com.squareup.okhttp.RequestBody value)
Add a form data part to the body.
|
MultipartBuilder |
addPart(com.squareup.okhttp.Headers headers,
com.squareup.okhttp.RequestBody body)
Add a part to the body.
|
com.squareup.okhttp.RequestBody |
build()
Assemble the specified parts into a request body.
|
MultipartBuilder |
type(com.squareup.okhttp.MediaType type) |
public static final com.squareup.okhttp.MediaType FORM
public MultipartBuilder()
public MultipartBuilder(String boundary)
boundary
to separate parts. Prefer the
no-argument constructor to defend against injection attacks.public MultipartBuilder type(com.squareup.okhttp.MediaType type)
public MultipartBuilder addPart(com.squareup.okhttp.Headers headers, com.squareup.okhttp.RequestBody body)
public MultipartBuilder addFormDataPart(String name, String filename, com.squareup.okhttp.RequestBody value)
public com.squareup.okhttp.RequestBody build()
Copyright © 2004-2014. All Rights Reserved.