Error uploading a file using Retrofit 2

后端 未结 2 902
别那么骄傲
别那么骄傲 2021-02-20 17:04

I\'m trying to upload a file (picture) to the server using Retrofit 2. I\'m following that tutorial which seems pretty easy at first, but didn\'t work in my case...

2条回答
  •  有刺的猬
    2021-02-20 17:29

    The Exceptions says that the first @Part doesn't needs a name in the annotation.

    @Multipart
    @POST(Constants.URL_UPLOAD)
    Call upload(@Part RequestBody description,
                              @Part MultipartBody.Part file);
    

提交回复
热议问题