jeasonlzy / okhttp-OkGo

OkGo - 3.0 震撼来袭,该库是基于 Http 协议,封装了 OkHttp 的网络请求框架,比 Retrofit 更简单易用,支持 RxJava,RxJava2,支持自定义缓存,支持批量断点下载管理和批量上传管理功能
Apache License 2.0
10.59k stars 2.55k forks source link

用POST请求上传的时候为什么不能既加文本参数,又上传文件呢? #538

Open NightMoonCat opened 6 years ago

NightMoonCat commented 6 years ago

如题

NightMoonCat commented 6 years ago

如果要实现我说的情况,有没有什么思路

toy-lin commented 6 years ago

感觉这个开源库都没有人解决问题的

uiatnys commented 6 years ago

OkGo.post(url) .params() .addFileParams("file",file) 这样可以的呀

NightMoonCat commented 6 years ago

嗯,已经处理好了,当时一块用的.params()和.upFile(),所以出问题了,现在已经解决了。感谢您的邮件! 已经测试了,确实可以既上传文本,也上传文件