我正在使用 Retrofit 2.0 创建用于在服务器上上传文件的改造服务。
我指的是 https://futurestud.io/blog/retrofit-2-how-to-upload-files-to-server
下面是我的 FileUploadService 代码:
interface TripHistoryFileUploadService {
@Multipart
@POST("trip/trip-history")
Call<ResponseBody> upload(@Part("json_file") RequestBody description,
@Part MultipartBody.Part file);
我正在使用以下改造版本:
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4'
但我收到错误尽管需要但缺少值,如下所示:
任何人都可以面对相同的问题或任何人都可以解决相同的问题吗?
最佳答案
beta Version is An early version of a program or application that contains most of the major features, but is not yet complete.
你应该使用稳定版
compile 'com.squareup.retrofit2:retrofit:2.0.2' //A type-safe HTTP client
然后 Clean -Rebuild-Sync
您的 IDE。希望这对您有帮助。
关于android - 尽管需要改造 2.0,但值(value)缺失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37672146/