OxyConfig constructor

const OxyConfig({
  1. Uri? baseUrl,
  2. HeadersInit? defaultHeaders,
  3. Duration connectTimeout = const Duration(seconds: 10),
  4. Duration requestTimeout = const Duration(seconds: 30),
  5. RedirectPolicy redirectPolicy = RedirectPolicy.follow,
  6. int maxRedirects = 5,
  7. bool keepAlive = false,
  8. RetryPolicy retryPolicy = const RetryPolicy(),
  9. HttpErrorPolicy httpErrorPolicy = HttpErrorPolicy.throwException,
  10. List<OxyMiddleware> middleware = const [],
  11. String userAgent = 'oxy/0.2.0',
})

Implementation

const OxyConfig({
  this.baseUrl,
  this.defaultHeaders,
  this.connectTimeout = const Duration(seconds: 10),
  this.requestTimeout = const Duration(seconds: 30),
  this.redirectPolicy = RedirectPolicy.follow,
  this.maxRedirects = 5,
  this.keepAlive = false,
  this.retryPolicy = const RetryPolicy(),
  this.httpErrorPolicy = HttpErrorPolicy.throwException,
  this.middleware = const [],
  this.userAgent = 'oxy/0.2.0',
}) : assert(maxRedirects >= 0, 'maxRedirects must be >= 0');