MultipartBuilder can't be resolved in okhttp:3.0.0-RC1

好久不见. 提交于 2019-12-18 07:34:52

问题


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

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

Recently I have updated with:

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

It shows error like MultipartBuilder can't be resolved.

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

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


回答1:


It is called MultipartBody.Builder now. From the 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.

You can read more here.



来源:https://stackoverflow.com/questions/34676044/multipartbuilder-cant-be-resolved-in-okhttp3-0-0-rc1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!