HttpFetcher constructor
HttpFetcher({
- required String userAgent,
- HttpClient client()?,
- Duration timeout = const Duration(seconds: 60),
A fetcher announcing itself as userAgent, making connections with
client (tests pass a fake), and giving up on a server that stays
silent for timeout.
Implementation
HttpFetcher({
required this.userAgent,
HttpClient Function()? client,
this.timeout = const Duration(seconds: 60),
}) : _client = client ?? HttpClient.new;