patch<T> method
Future<Result<T> >
patch<T>(
- String path, {
- dynamic data,
- Map<
String, dynamic> ? queryParameters, - FutureOr<
T> onSuccess(- dynamic data
- FutureOr<
T> onError(- dynamic data
- RestApiClientRequestOptions? options,
override
Implementation
@override
Future<Result<T>> patch<T>(
String path, {
data,
Map<String, dynamic>? queryParameters,
FutureOr<T> Function(dynamic data)? onSuccess,
FutureOr<T> Function(dynamic data)? onError,
RestApiClientRequestOptions? options,
}) async {
try {
final response = await _dio.patch(
path,
queryParameters: queryParameters,
data: data,
options: options?.toOptions(),
);
return NetworkResult(
response: response,
data: await _resolveResult(response.data, onSuccess),
);
} on DioException catch (e) {
await exceptionHandler.handle(e, silent: options?.silentException);
return NetworkResult(
response: e.response,
exception: e,
statusCode: e.response?.statusCode,
statusMessage: e.response?.statusMessage,
);
}
}