RequestUtil class

Constructors

RequestUtil({required String baseUrl, required String path, required RequestMethod method, required RequestParams? params, required RequestSuccess success, required RequestError error, RequestHeaders? headers, RequestInterceptors? interceptors})
初始化 baseUrl 请求域名/ip path url地址 method 请求方法 params 发起请求的param参数 success 成功回调 error 失败回调 headers 单独设置的请求头 interceptors 自定义拦截器

Properties

baseUrl String
getter/setter pair
dio ↔ Dio
latefinal
error RequestError
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
method RequestMethod
getter/setter pair
params RequestParams?
getter/setter pair
path String
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
success RequestSuccess
getter/setter pair

Methods

get({required CancelToken cancelToken}) Future<void>
发起get请求 params 发起请求的param参数 cancelToken 取消请求的cancelToken
getAuthorizationHeader() Map<String, dynamic>?
添加单独认证
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
post({required CancelToken cancelToken}) Future<void>
发起get请求 cancelToken 取消请求的cancelToken
toString() String
A string representation of this object.
inherited

Operators

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

Constants

kConnectTimeout → const int
kReceiveTimeout → const int