Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

参数和文件要一起上传怎么整? #107

Open
wwwgaoxi opened this issue Apr 14, 2022 · 1 comment
Open

参数和文件要一起上传怎么整? #107

wwwgaoxi opened this issue Apr 14, 2022 · 1 comment

Comments

@wwwgaoxi
Copy link

用户上传文件,需要把文件和用户ID 绑定,所以用户id需要一起上传

用rxUploadWithPartMap,都添加上去行不通,请问怎么 把参数跟文件一起上传?

var string="audio/mp3"
var requestBody= RequestBody.create(MediaType.parse(string),mp3File)
val maps= ArrayMap<String, MultipartBody.Part>()
maps["file"] = MultipartBody.Part.createFormData("file", mp3File.name, requestBody)
maps["bizId"] = MultipartBody.Part.createFormData("userID", "649")

novate.rxUploadWithPartMap(URL, maps, object : RxStringCallback() {})

@HeroGentry
Copy link

HeroGentry commented Apr 14, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants