# Package com.drake.net.request

## Types

BaseRequest
Link copied to clipboard
abstract class BaseRequest
Content copied to clipboard
BodyRequest
Link copied to clipboard
open class BodyRequest : BaseRequest
Content copied to clipboard
MediaConst
Link copied to clipboard
object MediaConst
Content copied to clipboard
Method
Link copied to clipboard
enum Method : Enum<Method>
Content copied to clipboard
UrlRequest
Link copied to clipboard
open class UrlRequest : BaseRequest
Content copied to clipboard

## Functions

addDownloadListener
Link copied to clipboard
fun Request.addDownloadListener(progressListener: ProgressListener)
Content copied to clipboard
addUploadListener
Link copied to clipboard
fun Request.addUploadListener(progressListener: ProgressListener)
Content copied to clipboard
converter
Link copied to clipboard
fun Request.converter(): NetConverter?
Content copied to clipboard
转换器
downloadConflictRename
Link copied to clipboard
fun Request.downloadConflictRename(): Boolean
Content copied to clipboard
当指定下载目录存在同名文件是覆盖还是进行重命名, 重命名规则是: $文件名_($序号).
downloadFileDir
Link copied to clipboard
fun Request.downloadFileDir(): String
Content copied to clipboard
下载文件目录
downloadFileName
Link copied to clipboard
fun Request.downloadFileName(): String?
Content copied to clipboard
下载文件名
downloadFileNameDecode
Link copied to clipboard
fun Request.downloadFileNameDecode(): Boolean
Content copied to clipboard
下载的文件名称是否解码 例如下载的文件名如果是中文, 服务器传输给你的会是被URL编码的字符串.
downloadListeners
Link copied to clipboard
fun Request.downloadListeners(): ConcurrentLinkedQueue<ProgressListener>?
Content copied to clipboard
下载监听器
downloadMd5Verify
Link copied to clipboard
fun Request.downloadMd5Verify(): Boolean
Content copied to clipboard
是否进行校验文件md5, 如果校验则匹配上既马上返回文件而不会进行下载
downloadTempFile
Link copied to clipboard
fun Request.downloadTempFile(): Boolean
Content copied to clipboard
下载是否使用临时文件 避免下载失败后覆盖同名文件或者无法判别是否已下载完整, 仅在下载完整以后才会显示为原有文件名 临时文件命名规则: 文件名 + .net-download 下载文件名: install.apk, 临时文件名: install.apk.
group
Link copied to clipboard
fun Request.group(): Any?
Content copied to clipboard
请求的分组名
id
Link copied to clipboard
fun Request.id(): Any?
Content copied to clipboard
请求的Id
isLogRecord
Link copied to clipboard
fun Request.isLogRecord(): Boolean?
Content copied to clipboard
是否记录日志
kType
Link copied to clipboard
fun Request.kType(): KType?
Content copied to clipboard
label
Link copied to clipboard
inline fun <T> Request.label(): T?
Content copied to clipboard
logString
Link copied to clipboard
fun Request.logString(byteCount: Long = 1024 * 1024): String?
Content copied to clipboard
请求日志信息 只会输出 application/x-www-form-urlencoded, application/json, text/`*` 的请求体类型日志
setConverter
Link copied to clipboard
fun Request.Builder.setConverter(converter: NetConverter): Request.Builder
Content copied to clipboard
setGroup
Link copied to clipboard
fun Request.Builder.setGroup(group: Any?): Request.Builder
Content copied to clipboard
setId
Link copied to clipboard
fun Request.Builder.setId(id: Any?): Request.Builder
Content copied to clipboard
setKType
Link copied to clipboard
fun Request.Builder.setKType(type: KType): Request.Builder
Content copied to clipboard
setLabel
Link copied to clipboard
inline fun <T> Request.Builder.setLabel(any: T): Request.Builder
Content copied to clipboard
setLogRecord
Link copied to clipboard
fun Request.Builder.setLogRecord(enabled: Boolean): Request.Builder
Content copied to clipboard
设置是否记录日志
setTag
Link copied to clipboard
fun Request.setTag(name: String, value: Any?): Request
Content copied to clipboard
请求标签
tag
Link copied to clipboard
fun Request.tag(name: String): Any?
Content copied to clipboard
请求标签
uploadListeners
Link copied to clipboard
fun Request.uploadListeners(): ConcurrentLinkedQueue<ProgressListener>?
Content copied to clipboard
上传监听器