HttpService class
Inheritance
Object
GetLifeCycle
DisposableInterface
GetxService
HttpService
Properties
baseUrl
→ String
地址前缀
final
connectTimeout
→ Duration ?
连接超时赶时间
final
dio
↔ Dio
getter/setter pair
hashCode
→ int
The hash code for this object.
no setter inherited
initialized
→ bool
Checks whether the controller has already been initialized.
no setter inherited
interceptors
→ List <Interceptor > ?
基础拦截器
final
isClosed
→ bool
Checks whether the controller has already been closed.
no setter inherited
onDelete
→ InternalFinalCallback<void >
Internal callback that starts the cycle of this controller.
final inherited
onStart
→ InternalFinalCallback<void >
Called at the exact moment the widget is allocated in memory.
It uses an internal "callable" type, to avoid any @overrides in subclases.
This method should be internal and is required to define the
lifetime cycle of the subclass.
final inherited
proxyConfig
→ Map <String , dynamic > ?
代理配置
final
receiveTimeout
→ Duration ?
接收超时赶时间
final
retryEnable
→ bool
重试开启
final
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
Methods
$configureLifeCycle ()
→ void
inherited
cancelRequests ({CancelToken? token })
→ void
delete (String path , {dynamic data , Map <String , dynamic > ? params , Options? options , CancelToken? cancelToken , bool refresh = false , bool noCache = !CACHE_ENABLE , String ? cacheKey , bool cacheDisk = false , bool showToastOnError = true , bool showMask = false })
→ Future
restful delete 操作
download (String path , dynamic savePath , {ProgressCallback? onReceiveProgress , Map <String , dynamic > ? queryParameters , CancelToken? cancelToken , bool deleteOnError = true , dynamic data , Options? options })
→ Future
文件下载
get (String path , {Map <String , dynamic > ? params , Options? options , CancelToken? cancelToken , bool refresh = false , bool noCache = !CACHE_ENABLE , String ? cacheKey , bool cacheDisk = false , bool showToastOnError = true , bool showMask = false })
→ Future
restful get 操作
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onClose ()
→ void
Called before onDelete method. onClose might be used to
dispose resources used by the controller. Like closing events,
or streams before the controller is destroyed.
Or dispose objects that can potentially create some memory leaks,
like TextEditingControllers, AnimationControllers.
Might be useful as well to persist some data on disk.
inherited
onInit ()
→ void
Called immediately after the widget is allocated in memory.
You might use this to initialize something for the controller.
override
onReady ()
→ void
Called 1 frame after onInit(). It is the perfect place to enter
navigation events, like snackbar, dialogs, or a new route, or
async request.
inherited
patch (String path , {dynamic data , Map <String , dynamic > ? params , Options? options , CancelToken? cancelToken , bool refresh = false , bool noCache = !CACHE_ENABLE , String ? cacheKey , bool cacheDisk = false , bool showToastOnError = true , bool showMask = false })
→ Future
restful patch 操作
post (String path , {Map <String , dynamic > ? params , dynamic data , Options? options , CancelToken? cancelToken , bool refresh = false , bool noCache = !CACHE_ENABLE , String ? cacheKey , bool cacheDisk = false , bool showToastOnError = true , bool showMask = false })
→ Future
restful post 操作
postForm (String path , {required Map <String , dynamic > params , Options? options , CancelToken? cancelToken , bool refresh = false , bool noCache = !CACHE_ENABLE , String ? cacheKey , bool cacheDisk = false , bool showToastOnError = true , bool showMask = false })
→ Future
restful post form 表单提交操作
put (String path , {dynamic data , Map <String , dynamic > ? params , Options? options , CancelToken? cancelToken , bool refresh = false , bool noCache = !CACHE_ENABLE , String ? cacheKey , bool cacheDisk = false , bool showToastOnError = true , bool showMask = false })
→ Future
restful put 操作
设置headers
toString ()
→ String
A string representation of this object.
inherited