get method
Sends an HTTP GET request with the given headers
to the given url
.
Implementation
Future<http.Response> get(String url, {Map<String, String>? headers}) async =>
await retry(
() => client
.get(
Uri.parse(Uri.encodeFull(url)),
headers: headers,
)
.timeout(const Duration(seconds: 20)),
delayFactor: const Duration(seconds: 5),
maxAttempts: 15,
retryIf: (e) => e is SocketException || e is TimeoutException,
onRetry: (e) => debugPrint('${e.runtimeType} - Retrying to GET $url'),
);