DfHttpClientConfig class

Configuration object for HTTP API calls used with df_http.

This class defines how requests are made, retried, and how headers are handled. It also supports token refresh logic.

Constructors

DfHttpClientConfig({required String baseApiUrl, Encoding? encoding, Map<String, String> headers = const {}, int timeout = 10, bool retryApiCall = true, bool waitForTokenRefresh = true, int maxRetryAttempts = 3, Future<Result<String, Exception>> refreshToken()?, int maxDelayMs = 60000, List<DfHttpInterceptor> interceptors = const [], Random? random, Future<bool> internetConnectionCheck()?})
Creates a new DfHttpClientConfig instance.

Properties

baseApiUrl → String
final
encoding → Encoding?
final
hashCode → int
The hash code for this object.
no setterinherited
hasInternetConnection ↔ Future<bool> Function()
getter/setter pair
headers ↔ Map<String, String>
getter/setter pair
interceptors → List<DfHttpInterceptor>
final
maxDelayMs → int
final
maxRetryAttempts → int
final
refreshToken ↔ Future<Result<String, Exception>> Function()?
getter/setter pair
retryApiCall → bool
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
timeout → int
final
waitForTokenRefresh ↔ bool
getter/setter pair

Methods

addHeaderParameters(Map<String, String> headers) → void
authorizationPresent() → bool
calculateRetryWaitingPeriod(int retryCount) → int
clone() → DfHttpClientConfig
copyWith({String? baseApiUrl, Encoding? encoding, Map<String, String>? headers, int? timeout, bool? retryApiCall, bool? waitForTokenRefresh, int? maxRetryAttempts, Future<Result<String, Exception>> refreshToken()?, List<DfHttpInterceptor>? interceptors}) → DfHttpClientConfig
getAuthorizationToken() → String?
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeAuthorization() → bool
removeHeaderParameter(String headerName) → bool
replaceHeaders(Map<String, String> headers) → void
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited