onSuccess method
void
onSuccess(
- VoltronHttpRequest request,
- VoltronHttpResponse response,
- JSPromise promise
override
success callback
Implementation
@override
void onSuccess(
VoltronHttpRequest request,
VoltronHttpResponse response,
JSPromise promise,
) {
var respMap = VoltronMap();
respMap.push("statusCode", response.statusCode);
var rspBody = '';
try {
rspBody = json.encode(response.data);
} catch (e) {
rspBody = response.data.toString();
}
respMap.push("respBody", rspBody);
respMap.push("statusLine", response.statusMessage);
respMap.push("respHeaders", response.headerMap.toVoltronMap());
respMap.push("respBody", rspBody);
promise.resolve(respMap);
}