Package kong.unirest.core
Interface MultipartBody
-
- All Superinterfaces:
Body
,HttpRequest<MultipartBody>
public interface MultipartBody extends HttpRequest<MultipartBody>, Body
Represents a multi-part body builder for a request.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MultipartBody
boundary(String boundaryIdentifier)
Sets the value to use as the boundary identifier.MultipartBody
charset(Charset charset)
Set the encoding of the request bodyMultipartBody
contentType(String mimeType)
Set the mime-type of the request bodyMultipartBody
field(String name, byte[] bytes, String fileName)
add a simple field with a name and valueMultipartBody
field(String name, byte[] bytes, ContentType contentType, String fileName)
add a simple field with a name and valueMultipartBody
field(String name, File file)
add a simple field with a name and valueMultipartBody
field(String name, File file, String contentType)
add a simple field with a name and valueMultipartBody
field(String name, InputStream stream, String fileName)
add a simple field with a name and valueMultipartBody
field(String name, InputStream value, ContentType contentType)
add a simple field with a name and valueMultipartBody
field(String name, InputStream stream, ContentType contentType, String fileName)
add a simple field with a name and valueMultipartBody
field(String name, String value)
add a simple field with a name and valueMultipartBody
field(String name, String value, String contentType)
add a simple field with a name and valueMultipartBody
field(String name, String value, ContentType contentType)
add a simple field with a name and valueMultipartBody
field(String name, Collection<?> values)
add a simple field with a name and valueMultipartBody
mode(MultipartMode value)
Set the Apache Mode.MultipartBody
uploadMonitor(ProgressMonitor monitor)
Set a file Progress upload monitor suitable for drawing progress bars and whatnot.-
Methods inherited from interface kong.unirest.core.Body
getBoundary, getCharset, getField, getMode, getMonitor, isEntityBody, isMultiPart, multiParts, uniPart
-
Methods inherited from interface kong.unirest.core.HttpRequest
accept, accept, asBytes, asBytesAsync, asBytesAsync, asEmpty, asEmptyAsync, asEmptyAsync, asFile, asFileAsync, asFileAsync, asJson, asJsonAsync, asJsonAsync, asObject, asObject, asObject, asObjectAsync, asObjectAsync, asObjectAsync, asObjectAsync, asObjectAsync, asPaged, asString, asStringAsync, asStringAsync, basicAuth, connectTimeout, cookie, cookie, cookie, downloadMonitor, getBody, getConnectTimeout, getCreationTime, getHeaders, getHttpMethod, getUrl, getVersion, header, headerReplace, headers, headersReplace, queryString, queryString, queryString, responseEncoding, routeParam, routeParam, thenConsume, thenConsumeAsync, toSummary, version, withObjectMapper
-
-
-
-
Method Detail
-
field
MultipartBody field(String name, String value)
add a simple field with a name and value- Parameters:
name
- : the Name of the form fieldvalue
- : The string value for the field- Returns:
- The same MultipartBody
-
field
MultipartBody field(String name, String value, String contentType)
add a simple field with a name and value- Parameters:
name
- : the Name of the form fieldvalue
- : The string value for the fieldcontentType
- : the content type of the value- Returns:
- The same MultipartBody
-
field
MultipartBody field(String name, String value, ContentType contentType)
add a simple field with a name and value- Parameters:
name
- : the Name of the form fieldvalue
- : The string value for the fieldcontentType
- : the content type of the value- Returns:
- The same MultipartBody
-
field
MultipartBody field(String name, Collection<?> values)
add a simple field with a name and value- Parameters:
name
- : the Name of the form fieldvalues
- : A collection of values for the same name.- Returns:
- The same MultipartBody
-
field
MultipartBody field(String name, File file)
add a simple field with a name and value- Parameters:
name
- : the Name of the form fieldfile
- : A File object.- Returns:
- The same MultipartBody
-
field
MultipartBody field(String name, File file, String contentType)
add a simple field with a name and value- Parameters:
name
- : the Name of the form fieldfile
- : A File object.contentType
- : the content mime-type of the file- Returns:
- The same MultipartBody
-
field
MultipartBody field(String name, InputStream value, ContentType contentType)
add a simple field with a name and value- Parameters:
name
- : the Name of the form fieldvalue
- : A input streamcontentType
- : the content mime-type of the file- Returns:
- The same MultipartBody
-
field
MultipartBody field(String name, InputStream stream, ContentType contentType, String fileName)
add a simple field with a name and value- Parameters:
name
- : the Name of the form fieldstream
- : A input streamcontentType
- : the content mime-type of the filefileName
- : the name of the file which will be included in the file part header- Returns:
- The same MultipartBody
-
field
MultipartBody field(String name, byte[] bytes, ContentType contentType, String fileName)
add a simple field with a name and value- Parameters:
name
- : the Name of the form fieldbytes
- : The raw bytes for the filecontentType
- : the content mime-type of the filefileName
- : the name of the file which will be included in the file part header- Returns:
- The same MultipartBody
-
field
MultipartBody field(String name, InputStream stream, String fileName)
add a simple field with a name and value- Parameters:
name
- : the Name of the form fieldstream
- : The raw bytes for the filefileName
- : the name of the file which will be included in the file part header- Returns:
- The same MultipartBody
-
field
MultipartBody field(String name, byte[] bytes, String fileName)
add a simple field with a name and value- Parameters:
name
- : the Name of the form fieldbytes
- : The raw bytes for the filefileName
- : the name of the file which will be included in the file part header- Returns:
- The same MultipartBody
-
charset
MultipartBody charset(Charset charset)
Set the encoding of the request body- Parameters:
charset
- the character set encoding of the body- Returns:
- The same MultipartBody
-
contentType
MultipartBody contentType(String mimeType)
Set the mime-type of the request body- Parameters:
mimeType
- the mime type of the body- Returns:
- The same MultipartBody
-
mode
MultipartBody mode(MultipartMode value)
Set the Apache Mode.- Parameters:
value
- the value of the mode- Returns:
- The same MultipartBody
-
uploadMonitor
MultipartBody uploadMonitor(ProgressMonitor monitor)
Set a file Progress upload monitor suitable for drawing progress bars and whatnot.- Parameters:
monitor
- a monitor- Returns:
- The same MultipartBody
-
boundary
MultipartBody boundary(String boundaryIdentifier)
Sets the value to use as the boundary identifier. see https://datatracker.ietf.org/doc/html/rfc2046- Parameters:
boundaryIdentifier
- the value- Returns:
- The same MultipartBody
-
-