post<T> method
override
Performs a POST request to the provided API URL with the given body
and returns the response.
path
: The URL for the POST request.body
: (optional) The request body.queryParameters
: (optional) The query parameters for the POST request.options
: (optional) The options to be merged with the base options.
Returns a Future that completes with the response data of type T
.
Throws a DioException if the request fails.
Implementation
@override
Future<T> post<T>(String path,
{Object? body,
Map<String, dynamic>? queryParameters,
Options? options}) async {
try {
final response = await _dio.post<T>(path,
data: body, queryParameters: queryParameters, options: options);
return response.data as T;
} on DioException catch (e) {
log("message: ${e.message}");
rethrow;
}
}