Package kong.unirest.core
Interface MultipartBody
- All Superinterfaces:
Body
,HttpRequest<MultipartBody>
- All Known Implementing Classes:
HttpRequestMultiPart
Represents a multi-part body builder for a request.
-
Method Summary
Modifier and TypeMethodDescriptionSets the value to use as the boundary identifier.Set the encoding of the request bodycontentType
(String mimeType) Set the mime-type of the request bodyadd a simple field with a name and valuefield
(String name, byte[] bytes, ContentType contentType, String fileName) add a simple field with a name and valueadd a simple field with a name and valueadd a simple field with a name and valuefield
(String name, InputStream stream, String fileName) add a simple field with a name and valuefield
(String name, InputStream value, ContentType contentType) add a simple field with a name and valuefield
(String name, InputStream stream, ContentType contentType, String fileName) add a simple field with a name and valueadd a simple field with a name and valueadd a simple field with a name and valuefield
(String name, String value, ContentType contentType) add a simple field with a name and valuefield
(String name, Collection<?> values) add a simple field with a name and valuemode
(MultipartMode value) Set the Apache Mode.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, cookie, cookie, cookie, downloadMonitor, getBody, getCreationTime, getHeaders, getHttpMethod, getRequestTimeout, getUrl, getVersion, header, headerReplace, headers, headersReplace, queryString, queryString, queryString, requestTimeout, responseEncoding, routeParam, routeParam, thenConsume, thenConsumeAsync, toSummary, version, withObjectMapper
-
Method Details
-
field
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
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
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
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
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
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
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
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
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
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
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
Set the encoding of the request body- Parameters:
charset
- the character set encoding of the body- Returns:
- The same MultipartBody
-
contentType
Set the mime-type of the request body- Parameters:
mimeType
- the mime type of the body- Returns:
- The same MultipartBody
-
mode
Set the Apache Mode.- Parameters:
value
- the value of the mode- Returns:
- The same MultipartBody
-
uploadMonitor
Set a file Progress upload monitor suitable for drawing progress bars and whatnot.- Parameters:
monitor
- a monitor- Returns:
- The same MultipartBody
-
boundary
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
-