net / com.drake.net / kotlinx.coroutines.CoroutineScope
Name | Summary |
---|---|
Delete | 异步网络请求fun <M> CoroutineScope.Delete(path: String , tag: Any ? = null, cache: CacheMode = CacheMode.HTTP, absolutePath: Boolean = false, uid: Any ? = coroutineContext[CoroutineExceptionHandler], block: Api.() -> Unit = {}): Deferred<M> |
Download | 用于提交URL体下载文件(默认GET请求)fun CoroutineScope.Download(path: String , dir: String = NetConfig.app.externalCacheDir!!.absolutePath, tag: Any ? = null, absolutePath: Boolean = false, method: RequestMethod = RequestMethod.GET, uid: Any ? = coroutineContext[CoroutineExceptionHandler], block: Api.() -> Unit = {}): Deferred< String > |
DownloadBody | 用于提交请求体下载文件(默认POST请求)fun CoroutineScope.DownloadBody(path: String , dir: String = NetConfig.app.externalCacheDir!!.absolutePath, tag: Any ? = null, absolutePath: Boolean = false, method: RequestMethod = RequestMethod.POST, uid: Any ? = coroutineContext[CoroutineExceptionHandler], block: Api.() -> Unit = {}): Deferred< String > |
DownloadImage | 异步下载图片, 图片宽高要求要么同时指定要么同时不指定 要求依赖 Glidefun CoroutineScope.DownloadImage(url: String , with: Int = -1, height: Int = -1): Deferred< File > |
Get | 异步网络请求fun <M> CoroutineScope.Get(path: String , tag: Any ? = null, cache: CacheMode = CacheMode.HTTP, absolutePath: Boolean = false, uid: Any ? = coroutineContext[CoroutineExceptionHandler], block: Api.() -> Unit = {}): Deferred<M> |
Head | 异步网络请求fun <M> CoroutineScope.Head(path: String , tag: Any ? = null, cache: CacheMode = CacheMode.HTTP, absolutePath: Boolean = false, uid: Any ? = coroutineContext[CoroutineExceptionHandler], block: Api.() -> Unit = {}): Deferred<M> |
Options | 异步网络请求fun <M> CoroutineScope.Options(path: String , tag: Any ? = null, cache: CacheMode = CacheMode.HTTP, absolutePath: Boolean = false, uid: Any ? = coroutineContext[CoroutineExceptionHandler], block: Api.() -> Unit = {}): Deferred<M> |
Patch | 异步网络请求fun <M> CoroutineScope.Patch(path: String , tag: Any ? = null, cache: CacheMode = CacheMode.HTTP, absolutePath: Boolean = false, uid: Any ? = coroutineContext[CoroutineExceptionHandler], block: Api.() -> Unit = {}): Deferred<M> |
Post | 异步网络请求fun <M> CoroutineScope.Post(path: String , tag: Any ? = null, cache: CacheMode = CacheMode.HTTP, absolutePath: Boolean = false, uid: Any ? = coroutineContext[CoroutineExceptionHandler], block: Api.() -> Unit = {}): Deferred<M> |
Put | 异步网络请求fun <M> CoroutineScope.Put(path: String , tag: Any ? = null, cache: CacheMode = CacheMode.HTTP, absolutePath: Boolean = false, uid: Any ? = coroutineContext[CoroutineExceptionHandler], block: Api.() -> Unit = {}): Deferred<M> |
Trace | 异步网络请求fun <M> CoroutineScope.Trace(path: String , tag: Any ? = null, cache: CacheMode = CacheMode.HTTP, absolutePath: Boolean = false, uid: Any ? = coroutineContext[CoroutineExceptionHandler], block: Api.() -> Unit = {}): Deferred<M> |