Package kong.unirest.core
Class HttpRequestMultiPart
- All Implemented Interfaces:
Body,HttpRequest<MultipartBody>,MultipartBody
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate Charsetprivate booleanprivate MultipartModeprivate ProgressMonitorFields inherited from class kong.unirest.core.BaseRequest
config, headers, method, url -
Constructor Summary
ConstructorsConstructorDescriptionHttpRequestMultiPart(HttpRequestBody httpRequest) HttpRequestMultiPart(HttpRequestMultiPart httpRequest) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate voidSets 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<?> collection) add a simple field with a name and value(package private) MultipartBodyforceMultiPart(boolean value) getBody()getMode()booleanbooleanmode(MultipartMode value) Set the Apache Mode.uploadMonitor(ProgressMonitor uploadMonitor) Set a file Progress upload monitor suitable for drawing progress bars and whatnot.Methods inherited from class kong.unirest.core.BaseRequest
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, equals, getCreationTime, getDownloadMonitor, getHeaders, getHttpMethod, getObjectMapper, getPath, getRequestTimeout, getUrl, getVersion, hashCode, header, headerReplace, headers, headersReplace, queryString, queryString, queryString, requestTimeout, responseEncoding, routeParam, routeParam, thenConsume, thenConsumeAsync, toSummary, version, withObjectMapperMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods 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, getCreationTime, getHeaders, getHttpMethod, getRequestTimeout, getUrl, getVersion, header, headerReplace, headers, headersReplace, queryString, queryString, queryString, requestTimeout, responseEncoding, routeParam, routeParam, thenConsume, thenConsumeAsync, toSummary, version, withObjectMapper
-
Field Details
-
parameters
-
mode
-
charSet
-
forceMulti
private boolean forceMulti -
monitor
-
boundary
-
-
Constructor Details
-
HttpRequestMultiPart
HttpRequestMultiPart(HttpRequestBody httpRequest) -
HttpRequestMultiPart
HttpRequestMultiPart(HttpRequestMultiPart httpRequest)
-
-
Method Details
-
field
Description copied from interface:MultipartBodyadd a simple field with a name and value- Specified by:
fieldin interfaceMultipartBody- Parameters:
name- : the Name of the form fieldvalue- : The string value for the field- Returns:
- The same MultipartBody
-
field
Description copied from interface:MultipartBodyadd a simple field with a name and value- Specified by:
fieldin interfaceMultipartBody- 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
Description copied from interface:MultipartBodyadd a simple field with a name and value- Specified by:
fieldin interfaceMultipartBody- 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
Description copied from interface:MultipartBodyadd a simple field with a name and value- Specified by:
fieldin interfaceMultipartBody- Parameters:
name- : the Name of the form fieldcollection- : A collection of values for the same name.- Returns:
- The same MultipartBody
-
field
Description copied from interface:MultipartBodyadd a simple field with a name and value- Specified by:
fieldin interfaceMultipartBody- Parameters:
name- : the Name of the form fieldvalue- : A input streamcontentType- : the content mime-type of the file- Returns:
- The same MultipartBody
-
field
Description copied from interface:MultipartBodyadd a simple field with a name and value- Specified by:
fieldin interfaceMultipartBody- Parameters:
name- : the Name of the form fieldfile- : A File object.- Returns:
- The same MultipartBody
-
field
Description copied from interface:MultipartBodyadd a simple field with a name and value- Specified by:
fieldin interfaceMultipartBody- Parameters:
name- : the Name of the form fieldfile- : A File object.contentType- : the content mime-type of the file- Returns:
- The same MultipartBody
-
field
public MultipartBody field(String name, InputStream stream, ContentType contentType, String fileName) Description copied from interface:MultipartBodyadd a simple field with a name and value- Specified by:
fieldin interfaceMultipartBody- 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
Description copied from interface:MultipartBodyadd a simple field with a name and value- Specified by:
fieldin interfaceMultipartBody- 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
Description copied from interface:MultipartBodyadd a simple field with a name and value- Specified by:
fieldin interfaceMultipartBody- 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
Description copied from interface:MultipartBodyadd a simple field with a name and value- Specified by:
fieldin interfaceMultipartBody- 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
Description copied from interface:MultipartBodySet the encoding of the request body- Specified by:
charsetin interfaceMultipartBody- Parameters:
charset- the character set encoding of the body- Returns:
- The same MultipartBody
-
contentType
Description copied from interface:MultipartBodySet the mime-type of the request body- Specified by:
contentTypein interfaceMultipartBody- Parameters:
mimeType- the mime type of the body- Returns:
- The same MultipartBody
-
mode
Description copied from interface:MultipartBodySet the Apache Mode.- Specified by:
modein interfaceMultipartBody- Parameters:
value- the value of the mode- Returns:
- The same MultipartBody
-
uploadMonitor
Description copied from interface:MultipartBodySet a file Progress upload monitor suitable for drawing progress bars and whatnot.- Specified by:
uploadMonitorin interfaceMultipartBody- Parameters:
uploadMonitor- a monitor- Returns:
- The same MultipartBody
-
boundary
Description copied from interface:MultipartBodySets the value to use as the boundary identifier. see https://datatracker.ietf.org/doc/html/rfc2046- Specified by:
boundaryin interfaceMultipartBody- Parameters:
boundaryIdentifier- the value- Returns:
- The same MultipartBody
-
getBoundary
- Specified by:
getBoundaryin interfaceBody
-
getCharset
- Specified by:
getCharsetin interfaceBody
-
fields
-
field
-
addPart
-
addPart
-
getBody
- Specified by:
getBodyin interfaceHttpRequest<MultipartBody>- Returns:
- if the request has a body it will be here.
-
isMultiPart
public boolean isMultiPart()- Specified by:
isMultiPartin interfaceBody
-
isEntityBody
public boolean isEntityBody()- Specified by:
isEntityBodyin interfaceBody
-
multiParts
- Specified by:
multiPartsin interfaceBody
-
getMode
-
getMonitor
- Specified by:
getMonitorin interfaceBody
-
forceMultiPart
-