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()?})
Creates a new DfHttpClientConfig instance.

Properties

baseApiUrl String
final
encoding Encoding?
final
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>
getter/setter pair
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
clone() DfHttpClientConfig
copyWith({String? baseApiUrl, Encoding? encoding, Map<String, String>? headers, int? timeout, bool? retryApiCall, bool? waitForTokenRefresh, int? maxRetryAttempts, Future<Result<String, Exception>> refreshToken()?}) 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