OxyConfig constructor
const
OxyConfig({
- Uri? baseUrl,
- HeadersInit? defaultHeaders,
- Duration connectTimeout = const Duration(seconds: 10),
- Duration requestTimeout = const Duration(seconds: 30),
- RedirectPolicy redirectPolicy = RedirectPolicy.follow,
- int maxRedirects = 5,
- bool keepAlive = false,
- RetryPolicy retryPolicy = const RetryPolicy(),
- HttpErrorPolicy httpErrorPolicy = HttpErrorPolicy.throwException,
- List<
OxyMiddleware> middleware = const [], - 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');