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

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

使用改造的 GET 請求不起作用,應(yīng)用程序崩潰

使用改造的 GET 請求不起作用,應(yīng)用程序崩潰

繁華開滿天機(jī) 2022-06-04 17:20:28
我需要使用改造來執(zhí)行獲取請求,但在調(diào)用我的界面中的方法之后應(yīng)用程序崩潰。這是我必須得到的 JSON 代碼:[{    "username": "matteo",    "conteggio": 5,    "isYou": 0},{    "username": "giovanni",    "conteggio": 7,    "isYou": 1}]我得到它添加郵件作為參數(shù)所以這是我的界面:public interface ServerService{String BASE_URL="https://seconda.herokuapp.com/";@GET("total?mail={mail}")Call<List<GetListParameters>> getList(@Path("mail") String mail);}這是它崩潰的活動(此代碼是 OnClickListener):Retrofit retrofit=new Retrofit.Builder()                        .baseUrl(ServerService.BASE_URL)                        .addConverterFactory(GsonConverterFactory.create())                        .build();                ServerService ss=retrofit.create(ServerService.class);                Call call=ss.getList(Mail); //the app crashes here                call.enqueue(new Callback<List<GetListParameters>>() {                    @Override                    public void onResponse(Call<List<GetListParameters>> call, Response<List<GetListParameters>> response) {                        if(response.isSuccessful()){                            ArrayList<UtenteAdapter> UtenteList=new ArrayList<>();                            for(GetListParameters item: response.body()){                                UtenteList.add(new UtenteAdapter(item.getUsername(), item.isYou(), item.getConteggio()));                            }我找不到我的錯(cuò)誤,非常感謝您的幫助。
查看完整描述

1 回答

?
守著星空守著你

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

它抱怨:


IllegalArgumentException: URL query string "mail={mail}" must not have replace block.

For dynamic query parameters use @Query.

這意味著,它不喜歡?和它后面的查詢字符串。


@GET("total")

Call<List<GetListParameters>> getList(@NonNull @Query(value = "mail") String mail);

^ 這將自動將查詢字符串附加到URL,因?yàn)樗囊馑际恰?/p>


查看完整回答
反對 回復(fù) 2022-06-04
  • 1 回答
  • 0 關(guān)注
  • 97 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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