Override the default response hander for the RestDataConnector.
The response handler is a function that handles the RestResponse returned form the RESTFul web service call. This is useful if the response is not JSON based and you want to return your own response object implementation.
Overriding the response object allows the customisation of response objects regardless of the Data Connector call.
JavaScript example:
// Define a custom response handler
function handleResponse(response) {
var body = JSON.parse(response.getBody());
return body.data;
};
var responseHandler = {
handleResponse: handleResponse,
};
restDataConnector.setResponseHandler(responseHandler);
The response handler is a function that handles the RestResponse returned form the RESTFul web service call. This is useful if the response is not JSON based and you want to return your own response object implementation.
Overriding the response object allows the customisation of response objects regardless of the Data Connector call.
JavaScript example: