request - getAsJsonContent()

Returns the request as an object of type JsonNode.

This method is available only in an Edge Encryption rule action script.

Table 1. Parameters
Name Type Description
None
Table 2. Returns
Type Description
JsonNode The request

This example is from the REST Json encryption rule.

function RESTJSONAction(request) {
	var urlArray = request.path.split('/');
    var tableName = urlArray[urlArray.length - 1];
	
	if (request.urlParams && request.urlParams.sysparm_query) {
		request.urlParams.sysparm_query.encodedQueryFor(tableName);
	}
	
	var jsonContent = request.getAsJsonContent();
	for (var jsonElementItr = jsonContent.iterator(); jsonElementItr.hasNext(); ) {
		var jsonElement = jsonElementItr.next();
		jsonElement.valueFor(tableName, jsonElement.getName());			
	}
}