net / com.drake.net / kotlinx.coroutines.CoroutineScope / Patch
Patch¶
inline fun <reified M> CoroutineScope.Patch(path:String, tag:Any? = null, cache: CacheMode = CacheMode.HTTP, absolutePath:Boolean= false, uid:Any? = coroutineContext[CoroutineExceptionHandler], noinline block: Api.() ->Unit= {}): Deferred<M>
异步网络请求
Parameters¶
path - String 请求路径, 非绝对路径会加上NetConfig.host为前缀
tag - 可以传递对象给Request请求, 一般用于在拦截器/转换器中进行针对某个接口行为判断
absolutePath - 请求路径是否是绝对路径
uid - 表示请求的唯一id, 和NetCancel.cancel中的uid一致, 一般用于指定取消网络请求的唯一id, 和NetCancel.cancel中的uid一致, 一般用于指定取消网络请求的唯一id
block - 函数中可以配置请求参数