第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

如何在Retrofit 2中上傳圖像文件

如何在Retrofit 2中上傳圖像文件

有只小跳蛙 2019-09-26 09:52:18
我有一個(gè)如下的郵遞員圖像。如何在翻新2中執(zhí)行相同的操作。我已經(jīng)聲明了這樣的接口。@Multipart@POST("/api/Pharmarcy/UploadImage")Call<ResponseBody> uploadPrescriptionImage(         @Query("accessToken") String token,         @Query("pharmarcyRequestId") int pharmacyRequestedId,         @Part MultipartBody.Part image);
查看完整描述

3 回答

?
繁華開滿天機(jī)

TA貢獻(xiàn)1816條經(jīng)驗(yàn) 獲得超4個(gè)贊

@Multipart@POST("user/updateprofile")Observable<ResponseBody> updateProfile(@Part("user_id") RequestBody id,
                                       @Part("full_name") RequestBody fullName,
                                       @Part MultipartBody.Part image,
                                       @Part("other") RequestBody other);//pass it like thisFile file = new File("/storage/emulated/0/Download/Corrections 6.jpg");RequestBody requestFile =
        RequestBody.create(MediaType.parse("multipart/form-data"), file);// MultipartBody.Part is used to send also the actual file nameMultipartBody.Part body =
        MultipartBody.Part.createFormData("image", file.getName(), requestFile);// add another part within the multipart requestRequestBody fullName = 
        RequestBody.create(MediaType.parse("multipart/form-data"), "Your Name");service.updateProfile(id, fullName, body, other);

看看我傳遞multipart和string參數(shù)的方式。希望這個(gè)能對您有所幫助!


查看完整回答
反對 回復(fù) 2019-09-26
  • 3 回答
  • 0 關(guān)注
  • 905 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)