Package io.vertx.mutiny.ext.web
Class RequestBody
java.lang.Object
io.vertx.mutiny.ext.web.RequestBody
- All Implemented Interfaces:
MutinyDelegate
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRequestBody(io.vertx.ext.web.RequestBody delegate) RequestBody(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionio.vertx.core.json.JsonArrayio.vertx.core.json.JsonArrayasJsonArray(int maxAllowedLength) io.vertx.core.json.JsonObjectio.vertx.core.json.JsonObjectasJsonObject(int maxAllowedLength) <R> R<R> RasString()booleanbuffer()booleanio.vertx.ext.web.RequestBodyinthashCode()booleanisEmpty()intlength()static RequestBodynewInstance(io.vertx.ext.web.RequestBody arg) toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
RequestBody
public RequestBody(io.vertx.ext.web.RequestBody delegate) -
RequestBody
-
-
Method Details
-
getDelegate
public io.vertx.ext.web.RequestBody getDelegate()- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
asString
- Returns:
- the entire HTTP request body as a string, assuming UTF-8 encoding if the request does not provide the content type charset attribute. If a charset is provided in the request that it shall be respected. The context must have first been routed to a
BodyHandlerfor this to be populated.
-
asString
- Parameters:
encoding- the encoding, e.g. "UTF-16"- Returns:
- the body
-
asJsonObject
public io.vertx.core.json.JsonObject asJsonObject(int maxAllowedLength) - Parameters:
maxAllowedLength- if the current buffer length is greater than the limit anIllegalStateExceptionis thrown. This can be used to avoid DDoS attacks on very long JSON payloads that could take over the CPU while attempting to parse the data.- Returns:
- Get the entire HTTP request body as a . The context must have first been routed to a
BodyHandlerfor this to be populated.
When the body isnullor the"null"JSON literal thennullis returned.
-
asJsonArray
public io.vertx.core.json.JsonArray asJsonArray(int maxAllowedLength) - Parameters:
maxAllowedLength- if the current buffer length is greater than the limit anIllegalStateExceptionis thrown. This can be used to avoid DDoS attacks on very long JSON payloads that could take over the CPU while attempting to parse the data.- Returns:
- Get the entire HTTP request body as a . The context must have first been routed to a
BodyHandlerfor this to be populated.
When the body isnullor the"null"JSON literal thennullis returned.
-
asJsonObject
public io.vertx.core.json.JsonObject asJsonObject()- Returns:
- Get the entire HTTP request body as a . The context must have first been routed to a
BodyHandlerfor this to be populated.
When the body isnullor the"null"JSON literal thennullis returned.
-
asJsonArray
public io.vertx.core.json.JsonArray asJsonArray()- Returns:
- Get the entire HTTP request body as a . The context must have first been routed to a
BodyHandlerfor this to be populated.
When the body isnullor the"null"JSON literal thennullis returned.
-
buffer
- Returns:
- Get the entire HTTP request body as a . The context must have first been routed to a
BodyHandlerfor this to be populated.
-
asPojo
- Parameters:
clazz-maxAllowedLength- if the current buffer length is greater than the limit anIllegalStateExceptionis thrown. This can be used to avoid DDoS attacks on very long JSON payloads that could take over the CPU while attempting to parse the data.- Returns:
- Get the entire HTTP request body as a POJO. The context must have first been routed to a
BodyHandlerfor this to be populated.
When the body isnullor the"null"JSON literal thennullis returned. WARNING: This feature requires jackson-databind. Or another JSON codec that implements POJO parsing
-
asPojo
- Parameters:
clazz-- Returns:
- Get the entire HTTP request body as a POJO. The context must have first been routed to a
BodyHandlerfor this to be populated.
When the body isnullor the"null"JSON literal thennullis returned. WARNING: This feature requires jackson-databind. Or another JSON codec that implements POJO parsing
-
length
public int length()- Returns:
- length in bytes.
-
isEmpty
public boolean isEmpty()- Returns:
trueif empty.
-
available
public boolean available()- Returns:
trueif body was parsed during the duration of the request.
-
newInstance
-