DioRequest class

Constructors

DioRequest({String? baseUrl, BaseOptions? op, LogInterceptor? log, CacheOptions? cache, String? cookiePath, List<Interceptor>? interceptorList})
构造方法 如果baseUrl不等于空,options中的baseUrl属性会被这个参数覆盖

Properties

cacheOptions ↔ CacheOptions?
缓存配置
getter/setter pair
cookieJar ↔ CookieJar?
Cookie 配置
getter/setter pair
dio → Dio
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cacheExists(String key) Future<bool>
判断指定key的缓存是否存在
cleanCache({CachePriority priorityOrBelow = CachePriority.high, bool staleOnly = false}) Future<void>
清除所有key的缓存
closeCache() Future<void>
释放底层资源
deleteAllCookie() Future
删除所以cookie
deleteCache(String key, {bool staleOnly = false}) Future<void>
删除缓存
deleteCookie(Uri uri, [bool withDomainSharedCookie = false]) Future<void>
删除指定Uri的Cookie
getCache(String key) Future<CacheResponse?>
获取指定Key的缓存
loadForRequest(Uri uri) Future<List<Cookie>?>
获取指定 uri 的 cookie。
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
saveFromResponse(Uri uri, List<Cookie> cookies) Future<void>
保存指定 uri 的 cookie。
setCache(CacheResponse response) Future<void>
设置缓存
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

getInstance({String? baseUrl, BaseOptions? op, List<Interceptor>? interceptorList}) Future<DioRequest>
创建默认的DioRequest实例