我已经使用okhttp,它的工作正常与以下依赖关系:
compile 'com.squareup.okhttp:okhttp:2.3.0'
最近我更新了:
compile 'com.squareup.okhttp3:okhttp:3.0.0-RC1'
我正在使用我的Previous Answer上传文件上传图像.
有没有办法使用okhttp来实现同样的事情:3.0.0-RC1?
解决方法
现在叫
MultipartBody.Builder.从ChangeLog:
Form and Multipart bodies are now modeled. We’ve replaced the opaque
FormEncodingBuilder with the more powerful FormBody and
FormBody.Builder combo. Similarly we’ve upgraded MultipartBuilder into
MultipartBody,MultipartBody.Part,and MultipartBody.Builder.
你可以阅读更多here