postRaw<T> method
Future<(int?, String?, T)>
postRaw<T>(
- String endpoint, {
- required dynamic data,
- required T fromJson(
- dynamic
Implementation
Future<(int? statusCode, String? message, T data)> postRaw<T>(
String endpoint, {
required dynamic data,
required T Function(dynamic) fromJson,
}) async {
try {
final response = await _dio.post(
endpoint,
data: data,
);
return (
response.statusCode,
response.statusMessage,
fromJson(response.data),
);
} on DioException catch (e) {
throw Exception(_handleError(e));
}
}