APIConfig constructor
APIConfig({
- Dio? dio,
- String? baseUrl,
- Duration? connectTimeout = const Duration(seconds: 60),
- String? contentType,
- bool ensureNonNullHeadersFields = false,
- bool ensureNonNullParametersFields = false,
- Parameters? extra,
- bool? followRedirects,
- HTTPHeader? headers,
- bool isHandleErrors = false,
- ListFormat? listFormat,
- int? maxRedirects,
- HTTPMethod? method = HTTPMethod.GET,
- bool? persistentConnection,
- bool postBodyByDefault = false,
- BodyFormat? postBodyFormat,
- @Deprecated('Use `postBodyByDefault` and `postBodyFormat` instead, it will be removed in next version.') bool postUseFormData = false,
- String prefixPath = '',
- bool preserveHeaderCase = false,
- Parameters? queryParameters,
- bool? receiveDataWhenStatusError,
- Duration? receiveTimeout = const Duration(seconds: 60),
- RequestEncoder? requestEncoder,
- ResponseDecoder? responseDecoder,
- ResponseType? responseType = ResponseType.json,
- Duration? sendTimeout,
- String suffixPath = '',
- ValidateStatus? validateStatus,
Implementation
APIConfig({
this.dio,
this.baseUrl,
this.connectTimeout = const Duration(seconds: 60),
this.contentType,
this.ensureNonNullHeadersFields = false,
this.ensureNonNullParametersFields = false,
this.extra,
this.followRedirects,
this.headers,
this.isHandleErrors = false,
// this.isToastErrors = false,
this.listFormat,
this.maxRedirects,
this.method = HTTPMethod.GET,
this.persistentConnection,
this.postBodyByDefault = false,
this.postBodyFormat,
@Deprecated(
'Use `postBodyByDefault` and `postBodyFormat` instead, it will be removed in next version.')
this.postUseFormData = false,
this.prefixPath = '',
this.preserveHeaderCase = false,
this.queryParameters,
this.receiveDataWhenStatusError,
this.receiveTimeout = const Duration(seconds: 60),
this.requestEncoder,
this.responseDecoder,
this.responseType = ResponseType.json,
this.sendTimeout,
this.suffixPath = '',
this.validateStatus,
});