简体   繁体   English

Retrofit2请求正文出现错误

[英]Retrofit2 requestbody gives error

On line number 3 It says can not resolve Create, what is wrong with this? 在第3行上说无法解析Create,这是什么问题? This supposed to work. 这应该工作。

private Uri filePath;
File file = new File(filePath.getPath());
RequestBody rbody = RequestBody.create(MediaType.parse("image/*"), file);

Yes It worked, I have to use okhttp3 in this case. 是的它起作用了,在这种情况下我必须使用okhttp3。 I was using okhttp 2 我正在使用okhttp 2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM