-
Notifications
You must be signed in to change notification settings - Fork 206
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
上传文件,增加formData参数,会有产生两个。 如图 #52
Comments
好的, 稍等我复现下问题. 仅上传文件存在这个问题是吧 |
是的 |
demo中无法复现, 你最好确认下(可能是输出日志工具的问题)或者fork仓库复现 上传文件实现代码在 override fun buildRequest(): Request {
val body = if (body != null) body else {
val form = formBody.build()
try {
partBody.build()
for (i in 0 until form.size) { // 如果存在文件就开始使用multiPartBody方式上传
val name = form.name(i)
val value = form.value(i)
partBody.addFormDataPart(name, value)
}
partBody.setType(mediaType).build()
} catch (e: IllegalStateException) {
form
}
}
return okHttpRequest.method(method.name, body)
.url(httpUrl.build())
.setConverter(converter)
.build()
} |
无法复现 |
我找到出现问题的原因了。 |
欢迎下次讨论 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: