Comments (6)
好的, 稍等我复现下问题. 仅上传文件存在这个问题是吧
from net.
是的
from net.
demo中无法复现, 你最好确认下(可能是输出日志工具的问题)或者fork仓库复现
上传文件实现代码在buildRequest
, 你也可以使用断点调试查看问题
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()
}
from net.
无法复现
from net.
我找到出现问题的原因了。
因为在RequestInterceptor中 buildRequest() 获取过一次Request对象,导致重复执行buildRequest(), 从而出现了相同的参数
from net.
欢迎下次讨论
from net.
Related Issues (20)
- 好,很好,非常好 HOT 2
- 有没有Websocket Api场景下的封装 HOT 1
- runMain 方法的优化咨询 HOT 2
- 请教强哥json请求问题 HOT 2
- Failed to resolve: com.github.liangjingkanji:Net:3.5.8 Failed to resolve: com.github.liangjingkanji:StateLayout:1.4.1 HOT 1
- 东哥,有没有专门搞下载库的意思 HOT 9
- 此框架会请求2次接口问题 HOT 2
- BodyRequest解析好像有问题 HOT 1
- 关闭网络之后发起请求,app直接崩溃了,不走ErrorHandler的onError方法 HOT 2
- ViewModel 扩展函数scopeNetLife有机率不执行 HOT 8
- 每次发请求都会创建NetCoroutineScope这样好吗? HOT 4
- 支持请求失败重试吗? HOT 1
- java.net.ProtocolException: unexpected end of stream HOT 3
- 提示 URLParseException 地址错误 HOT 1
- 全局配置仿IOS菊花加载框
- 作者嘴太臭了,大家别用 HOT 2
- 大佬,后续有计划适配Cronet吗? HOT 1
- Get 请求如何参数数组? HOT 2
- 打包可以把源码打上来吗?
- 超时的设置问题 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from net.