delete method
Future<T>
delete({
- required TGDeleteRequest request,
- dynamic onSuccess(
- dynamic T
- dynamic onError(
- dynamic T
Implementation
Future<T> delete(
{required TGDeleteRequest request, onSuccess(T)?, onError(T)?}) async {
try {
Uri uri = Uri.parse(request.getUrl());
TGLog.t("DELETE", uri);
final httpRes = await _getClient(request.getUri(), "DELETE").delete(
uri,
body: request.body(),
headers: request.headers(),
);
return _performCallback(httpRes, onError, onSuccess);
} catch (error) {
T t = _populateExceptionResponse(error);
onError!(t);
return t;
}
}