@groovy.transform.CompileStatic static class MultipartBody.MultipartBuilder extends java.lang.Object
Builder used to assemble multipart text and file parts.
| Constructor and description |
|---|
MultipartBody.MultipartBuilder() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
MultipartBody.MultipartBuilder |
addPart(java.lang.String name, java.lang.String value)Adds a text form field. |
|
MultipartBody.MultipartBuilder |
addPart(java.lang.String name, java.lang.String filename, java.lang.String contentType, byte[] bytes)Adds a file form field. |
|
MultipartBody.MultipartBuilder |
addPart(java.lang.String name, java.lang.String filename, java.lang.String contentType, java.lang.String content)Adds a file form field using the configured charset to convert text content. |
|
MultipartBody |
build()Encodes all configured parts into a single multipart payload. |
|
MultipartBody.MultipartBuilder |
withCharset(java.nio.charset.Charset charset)Sets the charset used when encoding multipart headers and text values. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Adds a text form field.
name - form field namevalue - field valueAdds a file form field.
name - form field namefilename - uploaded filenamecontentType - mime type for the filebytes - file payload bytesAdds a file form field using the configured charset to convert text content.
name - form field namefilename - uploaded filenamecontentType - mime type for the filecontent - file content as textEncodes all configured parts into a single multipart payload.
Sets the charset used when encoding multipart headers and text values.
Defaults to UTF-8.
charset - charset to use; if null, UTF-8 is used