HttpConfig class

Constructors

HttpConfig.new({required String baseUrl, Duration connectTimeout = const Duration(seconds: 15), Duration receiveTimeout = const Duration(seconds: 15), Duration sendTimeout = const Duration(seconds: 15), Map<String, dynamic> commonHeaders()?, List<Interceptor> interceptors = const [], bool enableLog = true, bool enableToken = true, bool enableRetry = true, int maxRetries = 3, Duration retriesDelay = const Duration(seconds: 1), String? getToken()?, Future<String> onRefreshToken()?, Future<void> onRefreshTokenFailed()?})

Properties

baseUrl String
final
commonHeaders Map<String, dynamic> Function()?
final
connectTimeout Duration
final
enableLog bool
final
enableRetry bool
final
enableToken bool
final
getCommonHeaders Map<String, dynamic>
获取当前通用请求头
no setter
getToken String? Function()?
final
hashCode int
The hash code for this object.
no setterinherited
interceptors List<Interceptor>
final
maxRetries int
final
onRefreshToken Future<String> Function()?
final
onRefreshTokenFailed Future<void> Function()?
final
receiveTimeout Duration
final
retriesDelay Duration
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sendTimeout Duration
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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