Package kong.unirest.core
Interface RequestBodyEntity
- All Superinterfaces:
Body
,HttpRequest<RequestBodyEntity>
- All Known Implementing Classes:
HttpRequestUniBody
-
Method Summary
Modifier and TypeMethodDescriptionbody
(byte[] bodyBytes) Set a byte array as the body of the requestbody
(InputStream body) Set a InputStream as the bodySet a Object as the body of the request.Set a String as the body of the requestbody
(JSONElement body) Set JSON on the bodySet JSON on the bodySet the Charset encoding for the Content-Type.contentType
(String type) default RequestBodyEntity
Removes any Charset for the Content-Type for when servers cannot process it.uploadMonitor
(ProgressMonitor monitor) Set a 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
-
body
Set a byte array as the body of the request- Parameters:
bodyBytes
- the byte[]- Returns:
- this request builder
-
body
Set a String as the body of the request- Parameters:
bodyAsString
- the String- Returns:
- this request builder
-
body
Set JSON on the body- Parameters:
jsonBody
- the JsonNode- Returns:
- this request builder
-
body
Set a InputStream as the body- Parameters:
body
- the Object- Returns:
- this request builder
-
body
Set JSON on the body- Parameters:
body
- the JSONElement- Returns:
- this request builder
-
body
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- Parameters:
body
- the Object- Returns:
- this request builder
-
charset
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- Parameters:
charset
- the charset- Returns:
- this request builder
-
noCharset
Removes any Charset for the Content-Type for when servers cannot process it. (e.g. application/x-www-form-urlencoded)- Returns:
- this request builder
-
contentType
- Parameters:
type
- The content mime type- Returns:
- this request builder
-
uploadMonitor
Set a Progress upload monitor suitable for drawing progress bars and whatnot. Works With- Parameters:
monitor
- a monitor- Returns:
- The same MultipartBody
-