Package kong.unirest.core
Interface RequestBodyEntity
-
- All Superinterfaces:
Body,HttpRequest<RequestBodyEntity>
public interface RequestBodyEntity extends HttpRequest<RequestBodyEntity>, Body
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description RequestBodyEntitybody(byte[] bodyBytes)Set a byte array as the body of the requestRequestBodyEntitybody(InputStream body)Set a InputStream as the bodyRequestBodyEntitybody(Object body)Set a Object as the body of the request.RequestBodyEntitybody(String bodyAsString)Set a String as the body of the requestRequestBodyEntitybody(JSONElement body)Set JSON on the bodyRequestBodyEntitybody(JsonNode jsonBody)Set JSON on the bodyRequestBodyEntitycharset(Charset charset)Set the Charset encoding for the Content-Type.RequestBodyEntitycontentType(String type)default RequestBodyEntitynoCharset()Removes any Charset for the Content-Type for when servers cannot process it.RequestBodyEntityuploadMonitor(ProgressMonitor monitor)Set a Progress upload monitor suitable for drawing progress bars and whatnot.-
Methods inherited from interface kong.unirest.core.Body
getCharset, getField, getMode, getMonitor, isEntityBody, isMultiPart, multiParts, uniPart
-
Methods inherited from interface kong.unirest.core.HttpRequest
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
-
body
RequestBodyEntity body(byte[] bodyBytes)
Set a byte array as the body of the request- Parameters:
bodyBytes- the byte[]- Returns:
- this request builder
-
body
RequestBodyEntity body(String bodyAsString)
Set a String as the body of the request- Parameters:
bodyAsString- the String- Returns:
- this request builder
-
body
RequestBodyEntity body(JsonNode jsonBody)
Set JSON on the body- Parameters:
jsonBody- the JsonNode- Returns:
- this request builder
-
body
RequestBodyEntity body(InputStream body)
Set a InputStream as the body- Parameters:
body- the Object- Returns:
- this request builder
-
body
RequestBodyEntity body(JSONElement body)
Set JSON on the body- Parameters:
body- the JSONElement- Returns:
- this request builder
-
body
RequestBodyEntity body(Object 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
RequestBodyEntity charset(Charset 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
default RequestBodyEntity 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
RequestBodyEntity contentType(String type)
- Parameters:
type- The content mime type- Returns:
- this request builder
-
uploadMonitor
RequestBodyEntity uploadMonitor(ProgressMonitor monitor)
Set a Progress upload monitor suitable for drawing progress bars and whatnot. Works With- Parameters:
monitor- a monitor- Returns:
- The same MultipartBody
-
-