Net
/
com.drake.net.utils
/
toRequestBody
to
Request
Body
fun
File
.
toRequestBody
(contentType:
MediaType
? = null):
RequestBody
Content copied to clipboard
创建File的RequestBody
Parameters
contentType
如果为null则通过判断扩展名来生成MediaType
fun
Uri
.
toRequestBody
():
RequestBody
Content copied to clipboard
当Uri指向的文件不存在时将抛出异常
FileNotFoundException