get<T> method
Future<T?>
get<T>(
- String url, {
- Object? data,
- Map<
String, String> ? queryParameters, - Options? options,
- CancelToken? cancelToken,
- ProgressCallback? onReceiveProgress,
Make a GET request
Implementation
Future<T?> get<T>(
String url, {
Object? data,
Map<String, String>? queryParameters,
Options? options,
CancelToken? cancelToken,
ProgressCallback? onReceiveProgress,
}) async {
Uri uri = Uri.parse(url);
if (queryParameters != null) {
uri = uri.replace(queryParameters: queryParameters);
}
if (T.toString() == 'dynamic') {
return await network(
request: (request) => request.getUri(uri,
data: data,
options: options,
cancelToken: cancelToken,
onReceiveProgress: onReceiveProgress),
);
}
return await network<T>(
request: (request) => request.getUri(uri,
data: data,
options: options,
cancelToken: cancelToken,
onReceiveProgress: onReceiveProgress),
);
}