index.md 4.3 KB

net / com.drake.net.request / okhttp3.Request

Extensions for okhttp3.Request

Name Summary
addDownloadListener fun Request.addDownloadListener(progressListener:ProgressListener):Unit
addUploadListener fun Request.addUploadListener(progressListener:ProgressListener):Unit
converter 转换器fun Request.converter():NetConverter?
downloadConflictRename 当指定下载目录存在同名文件是覆盖还是进行重命名, 重命名规则是: $文件名_($序号).$后缀fun Request.downloadConflictRename():Boolean
downloadFileDir 下载文件目录fun Request.downloadFileDir():String
downloadFileName 下载文件名fun Request.downloadFileName():String?
downloadFileNameDecode 下载的文件名称是否解码 例如下载的文件名如果是中文, 服务器传输给你的会是被URL编码的字符串. 你使用URL解码后才是可读的中文名称fun Request.downloadFileNameDecode():Boolean
downloadListeners 下载监听器fun Request.downloadListeners():ConcurrentLinkedQueue<ProgressListener>?
downloadMd5Verify 是否进行校验文件md5, 如果校验则匹配上既马上返回文件而不会进行下载fun Request.downloadMd5Verify():Boolean
downloadTempFile 下载是否使用临时文件 避免下载失败后覆盖同名文件或者无法判别是否已下载完整, 仅在下载完整以后才会显示为原有文件名 临时文件命名规则: 文件名 + .net-download 下载文件名: install.apk, 临时文件名: install.apk.net-downloadfun Request.downloadTempFile():Boolean
group 请求的分组名fun Request.group():Any?
id 请求的Idfun Request.id():Any?
isLogRecord 是否记录日志fun Request.isLogRecord(): <ERROR CLASS>
label fun <T> Request.label(): T?
logString 请求日志信息 只会输出纯表单(form)的请求参数fun Request.logString(byteCount:Long= 1024 * 1024):String?
setTag 请求标签fun Request.setTag(name:String, value:Any?): <ERROR CLASS>
tag 请求标签fun Request.tag(name:String):Any?
uploadListeners 上传监听器fun Request.uploadListeners():ConcurrentLinkedQueue<ProgressListener>?