get method
Future
get(
- String uri, {
- Map<String, dynamic>? queryParameters,
- CancelToken? cancelToken,
- ProgressCallback? onReceiveProgress,
})
Implementation
Future<dynamic> get(
String uri, {
Map<String, dynamic>? queryParameters,
Future<Map<String, dynamic>>? headers,
CancelToken? cancelToken,
ProgressCallback? onReceiveProgress,
}) async {
try {
final Response response = await _dio.get(
uri,
queryParameters: queryParameters,
options: Options(
contentType: Headers.jsonContentType,
headers: await headers,
),
cancelToken: cancelToken,
onReceiveProgress: onReceiveProgress,
);
return response.data;
} on DioError catch (e) {
final exeception = await _apiErrorHandler(e);
throw exeception;
} catch (e) {
rethrow;
}
}