okhttp:3.0.0-RC1无法解析MultipartBuilder [英] MultipartBuilder can't be resolved in okhttp:3.0.0-RC1

查看:105
本文介绍了okhttp:3.0.0-RC1无法解析MultipartBuilder的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了 okhttp ,并且在以下依赖项下工作正常:

I have used okhttp and It's working fine with following dependency:

compile 'com.squareup.okhttp:okhttp:2.3.0'

最近我已更新:

compile 'com.squareup.okhttp3:okhttp:3.0.0-RC1'

它显示错误,例如 MultipartBuilder 无法解决.

It shows error like MultipartBuilder can't be resolved.

我正在使用我的上传文件的上一个答案上传图片.

I am uploading image with my Previous Answer of Uploading File.

有什么方法可以使用okhttp:3.0.0-RC1实现相同的目的吗?

Is there any way to achieve the same thing using okhttp:3.0.0-RC1 ?

推荐答案

它称为

It is called MultipartBody.Builder now. From the ChangeLog:

现在可以对Form和Multipart实体进行建模.我们已经更换了不透明的 具有更强大的FormBody和的FormEncodingBuilder FormBody.Builder组合.同样,我们已经将MultipartBuilder升级到 MultipartBody,MultipartBody.Part和MultipartBody.Builder.

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.

您可以在此处了解更多信息.

You can read more here.

这篇关于okhttp:3.0.0-RC1无法解析MultipartBuilder的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆