Package com.drake.net.body

Types

NetRequestBody
Link copied to clipboard
class NetRequestBody(body: RequestBody, progressListeners: ConcurrentLinkedQueue<ProgressListener>?) : RequestBody
NetResponseBody
Link copied to clipboard
class NetResponseBody(body: ResponseBody, progressListeners: ConcurrentLinkedQueue<ProgressListener>?, complete: () -> Unit?) : ResponseBody

Functions

fileName
Link copied to clipboard
fun MultipartBody.Part.fileName(): String?
获取Content-Disposition里面的filename属性值 可以此来判断是否为文件类型
name
Link copied to clipboard
fun MultipartBody.Part.name(): String?
获取Content-Disposition里面的字段名称
peekBytes
Link copied to clipboard
fun RequestBody.peekBytes(byteCount: Long = 1024 * 1024): ByteString
复制一段指定长度的字符串内容
fun ResponseBody.peekBytes(byteCount: Long = 1024 * 1024): ByteString
复制一段指定长度的字符串内容
toNetRequestBody
Link copied to clipboard
fun RequestBody.toNetRequestBody(listeners: ConcurrentLinkedQueue<ProgressListener>? = null): NetRequestBody
toNetResponseBody
Link copied to clipboard
fun ResponseBody.toNetResponseBody(listeners: ConcurrentLinkedQueue<ProgressListener>? = null, complete: () -> Unit? = null): NetResponseBody
value
Link copied to clipboard
fun MultipartBody.Part.value(): String?
MultipartBody.Part.body作为字符串返回 如果MultipartBody.Part有指定fileName那么视为文件类型将返回fileName值而不是文件内容