DfHttpClientConfig constructor
DfHttpClientConfig({})
Creates a new DfHttpClientConfig instance.
baseApiUrl is required and should be the base URL for your API.
encoding: Optional request/response encoding (e.g. UTF-8).headers: Default headers added to every request.timeout: Request timeout in seconds (default: 10).retryApiCall: Whether failed API calls should automatically retry.waitForTokenRefresh: Whether requests should wait until token refresh completes.maxRetryAttempts: Maximum number of retry attempts for failed requests.refreshToken: Callback used to refresh tokens if authentication fails.
Implementation
DfHttpClientConfig({
required this.baseApiUrl,
this.encoding,
this.headers = const {},
this.timeout = 10,
this.retryApiCall = true,
this.waitForTokenRefresh = true,
this.maxRetryAttempts = 3,
this.refreshToken,
});