onSuccess method

  1. @override
void onSuccess(
  1. dynamic response
)
override

Successful completion

Implementation

@override
void onSuccess(dynamic response) {
  jsonResponse.jsonCmisResponse = jsonobject.JsonObjectLite<dynamic>();

  // If stringify fails we may have a document body returned, ie straight text,
  // in this case create a JsonObject with this as its value.
  try {
    final dynamic successAsJson =
        jsonobject.JsonObjectLite<dynamic>.fromJsonString(response.body);
    generateSuccessResponse(successAsJson);
  } on Exception {
    final dynamic successAsJson = jsonobject.JsonObjectLite<dynamic>();
    successAsJson['rawText'] = response.body;
    generateSuccessResponse(successAsJson);
  }

  // Set the response headers
  allResponseHeaders = response.headers.keys.toString();
}