0
中的文件圖像?我知道有使用@Part MultipartBody.Part file
的其他技術,但我希望有一個更好的辦法,所以我可以以這種格式提交數據:改造:</p> <pre><code>public Class Attachment{ public String id; public File imageFile; } // Service @Multipart @POST("attachments") Call<Void> upload(@Part("attachment") Attachment attachment); </code></pre> <p>我怎樣才能成功上傳的圖片文件:鑑於我有這些上傳模型
attachment: {
id: 1
imageFile: //image data here
}