get method
Implementation
Future<Response<dynamic>> get({
required String path,
void Function(int, int)? onReceiveProgress,
Map<String, dynamic>? queryParameters,
String contentType = 'application/json',
Map<String, dynamic>? headers,
}) async {
//holds request options
final options = headers != null
? Options(
responseType: ResponseType.json,
contentType: contentType,
headers: headers,
)
: Options(
responseType: ResponseType.json,
contentType: contentType,
);
debugPrint('================DioClientExtended Get REQUEST================');
// debugPrint('REQUEST BODY: $body');
try {
final response = await dioClient.get<dynamic>(
path,
queryParameters: queryParameters,
onReceiveProgress: onReceiveProgress,
options: options,
);
debugPrint('================DioClientExtended Get RESPONSE================');
debugPrint('STATUS CODE: ${response.statusCode}');
debugPrint('DATA: ${response.data}');
return response;
} on DioException catch (e) {
debugPrint('DioException: $e');
rethrow;
}
}