Net

object Net

Functions

addDownloadListener
Link copied to clipboard
fun addDownloadListener(id: Any, progressListener: ProgressListener)
监听正在请求的下载进度
addUploadListener
Link copied to clipboard
fun addUploadListener(id: Any, progressListener: ProgressListener)
监听正在请求的上传进度
cancelAll
Link copied to clipboard
fun cancelAll()
取消全部网络请求
cancelGroup
Link copied to clipboard
fun cancelGroup(group: Any?): Boolean
根据分组取消网络请求
cancelId
Link copied to clipboard
fun cancelId(id: Any?): Boolean
取消指定的网络请求, Id理论上是唯一的, 所以该函数一次只能取消一个请求
delete
Link copied to clipboard
fun delete(path: String, tag: Any? = null, block: BodyRequest.() -> Unit? = null): BodyRequest
get
Link copied to clipboard
fun get(path: String, tag: Any? = null, block: UrlRequest.() -> Unit? = null): UrlRequest
同步网络请求
head
Link copied to clipboard
fun head(path: String, tag: Any? = null, block: UrlRequest.() -> Unit? = null): UrlRequest
options
Link copied to clipboard
fun options(path: String, tag: Any? = null, block: UrlRequest.() -> Unit? = null): UrlRequest
patch
Link copied to clipboard
fun patch(path: String, tag: Any? = null, block: BodyRequest.() -> Unit? = null): BodyRequest
post
Link copied to clipboard
fun post(path: String, tag: Any? = null, block: BodyRequest.() -> Unit? = null): BodyRequest
put
Link copied to clipboard
fun put(path: String, tag: Any? = null, block: BodyRequest.() -> Unit? = null): BodyRequest
removeDownloadListener
Link copied to clipboard
fun removeDownloadListener(id: Any, progressListener: ProgressListener)
删除正在请求的下载进度监听器
removeUploadListener
Link copied to clipboard
fun removeUploadListener(id: Any, progressListener: ProgressListener)
删除正在请求的上传进度监听器
requestByGroup
Link copied to clipboard
fun requestByGroup(group: Any): ArrayList<Request>
指定分组的请求
requestById
Link copied to clipboard
fun requestById(id: Any): Request?
指定Id的请求
trace
Link copied to clipboard
fun trace(path: String, tag: Any? = null, block: UrlRequest.() -> Unit? = null): UrlRequest