send method
Implementation
@override
send() async {
headers.addAll(CCRestApi.options.defaultHeaders);
CCRestApi.loggingOptions.broadcastRequest(getUri().toString());
http.Response? response = await handleRequest();
if (response == null) {
CCRestApi.loggingOptions.broadcastError("Unknown Request Type");
return;
}
Map<String, dynamic> responseDTO = {};
if (response.body.trim().isNotEmpty) {
try {
responseDTO = jsonDecode(response.body);
CCRestApi.loggingOptions.broadcastResponse(responseDTO.toString());
} catch (e) {
if (CCRestApi.loggingOptions.onError != null) {
CCRestApi.loggingOptions.broadcastError(e.toString());
}
}
}
this.response(responseDTO);
return responseDTO;
}