Package kong.unirest
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 RequestBodyEntity
body(byte[] bodyBytes)
Set a byte array as the body of the requestRequestBodyEntity
body(Object body)
Set a Object as the body of the request.RequestBodyEntity
body(String bodyAsString)
Set a String as the body of the requestRequestBodyEntity
body(JSONElement body)
Set JSON on the bodyRequestBodyEntity
body(JsonNode jsonBody)
Set JSON on the bodyRequestBodyEntity
charset(Charset charset)
Set the Charset encoding for the Content-Type.RequestBodyEntity
contentType(String type)
default RequestBodyEntity
noCharset()
Removes any Charset for the Content-Type for when servers cannot process it.-
Methods inherited from interface kong.unirest.Body
getCharset, getField, getMode, getMonitor, isEntityBody, isMultiPart, multiParts, uniPart
-
Methods inherited from interface kong.unirest.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, header, headerReplace, headers, queryString, queryString, queryString, responseEncoding, routeParam, routeParam, thenConsume, thenConsumeAsync, toSummary, 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(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
-
-