getBody #
Available since 2.11.0
Returns the provided request's body.
Arguments #
getBody (def: JSONObject = null): JSONObject
Name | Type | Description |
---|---|---|
name | string | Parameter name |
def | JSONObject | Default value to return if the body is not set |
Example #
const body = request.getBody();
// equivalent
const body = request.input.body;
//+ checks to make sure that the body is of the right type
// and throw standard API error when it's not the case
Edit this page on Github(opens new window)