HttpResultHandler constructor

HttpResultHandler({
  1. String baseUrl = '',
  2. Map<String, String> defaultHeaders = const <String, String>{},
  3. Duration timeout = const Duration(seconds: 30),
  4. Client? client,
})

Creates a new handler.

client lets tests inject a MockClient. If omitted, a fresh http.Client is created and owned by this handler — call close when you're done.

Implementation

HttpResultHandler({
  this.baseUrl = '',
  this.defaultHeaders = const <String, String>{},
  this.timeout = const Duration(seconds: 30),
  http.Client? client,
})  : _client = client ?? http.Client(),
      _ownsClient = client == null;