Package kong.unirest.core
Class HttpRequestUniBody
- All Implemented Interfaces:
Body
,HttpRequest<RequestBodyEntity>
,RequestBodyEntity
-
Field Summary
FieldsFields inherited from class kong.unirest.core.BaseRequest
config, headers, method, url
-
Constructor Summary
ConstructorsConstructorDescriptionHttpRequestUniBody
(HttpRequestBody httpRequest) HttpRequestUniBody
(HttpRequestUniBody httpRequest) -
Method Summary
Modifier and TypeMethodDescriptionbody
(byte[] bodyBytes) Set a byte array as the body of the requestbody
(InputStream inputStreamBody) Set a InputStream as the bodySet a Object as the body of the request.Set a String as the body of the requestbody
(JSONElement jsonBody) Set JSON on the bodySet JSON on the bodySet the Charset encoding for the Content-Type.contentType
(String type) getBody()
boolean
boolean
uniPart()
uploadMonitor
(ProgressMonitor progressMonitor) Set a 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, withObjectMapper
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface kong.unirest.core.Body
getBoundary, getField, getMode, multiParts
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, getCreationTime, getHeaders, getHttpMethod, getRequestTimeout, getUrl, getVersion, header, headerReplace, headers, headersReplace, queryString, queryString, queryString, requestTimeout, responseEncoding, routeParam, routeParam, thenConsume, thenConsumeAsync, toSummary, version, withObjectMapper
Methods inherited from interface kong.unirest.core.RequestBodyEntity
noCharset
-
Field Details
-
body
-
charSet
-
monitor
-
-
Constructor Details
-
HttpRequestUniBody
HttpRequestUniBody(HttpRequestBody httpRequest) -
HttpRequestUniBody
HttpRequestUniBody(HttpRequestUniBody httpRequest)
-
-
Method Details
-
body
Description copied from interface:RequestBodyEntity
Set JSON on the body- Specified by:
body
in interfaceRequestBodyEntity
- Parameters:
jsonBody
- the JsonNode- Returns:
- this request builder
-
body
Description copied from interface:RequestBodyEntity
Set a InputStream as the body- Specified by:
body
in interfaceRequestBodyEntity
- Parameters:
inputStreamBody
- the Object- Returns:
- this request builder
-
body
Description copied from interface:RequestBodyEntity
Set JSON on the body- Specified by:
body
in interfaceRequestBodyEntity
- Parameters:
jsonBody
- the JSONElement- Returns:
- this request builder
-
body
Description copied from interface:RequestBodyEntity
Set a Object as the body of the request. This will be serialized with one of the following methods: - Strings are native - JSONElements use their native toString - Everything else will pass through the supplied ObjectMapper- Specified by:
body
in interfaceRequestBodyEntity
- Parameters:
objectBody
- the Object- Returns:
- this request builder
-
body
Description copied from interface:RequestBodyEntity
Set a String as the body of the request- Specified by:
body
in interfaceRequestBodyEntity
- Parameters:
bodyAsString
- the String- Returns:
- this request builder
-
body
Description copied from interface:RequestBodyEntity
Set a byte array as the body of the request- Specified by:
body
in interfaceRequestBodyEntity
- Parameters:
bodyBytes
- the byte[]- Returns:
- this request builder
-
charset
Description copied from interface:RequestBodyEntity
Set the Charset encoding for the Content-Type. This is appended to the Content-Type Header (e.g. application/x-www-form-urlencoded; charset=US-ASCII) Default is UTF-8- Specified by:
charset
in interfaceRequestBodyEntity
- Parameters:
charset
- the charset- Returns:
- this request builder
-
contentType
- Specified by:
contentType
in interfaceRequestBodyEntity
- Parameters:
type
- The content mime type- Returns:
- this request builder
-
uploadMonitor
Description copied from interface:RequestBodyEntity
Set a Progress upload monitor suitable for drawing progress bars and whatnot. Works With- Specified by:
uploadMonitor
in interfaceRequestBodyEntity
- Parameters:
progressMonitor
- a monitor- Returns:
- The same MultipartBody
-
getBody
- Specified by:
getBody
in interfaceHttpRequest<RequestBodyEntity>
- Returns:
- if the request has a body it will be here.
-
getCharset
- Specified by:
getCharset
in interfaceBody
-
isMultiPart
public boolean isMultiPart()- Specified by:
isMultiPart
in interfaceBody
-
isEntityBody
public boolean isEntityBody()- Specified by:
isEntityBody
in interfaceBody
-
uniPart
-
getMonitor
- Specified by:
getMonitor
in interfaceBody
-