gpt4 book ai didi

android - 如何在改造android中发布数组

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:31:01 24 4
gpt4 key购买 nike

如何通过 post 方法在改造中发布以下参数?

 "params":{"body": {
"learning_objective_uuids": [
"ED4FE2BB2008FDA9C8133FF462959C0968FAB98C4D1DB8F2"
],
"note": "FasfAFSASFASDF",
"user_uuids": [
"EDF8B7EC20005ACC5C40FF7D6E988801F5BAD83CBBCDB97F",
"EDF8F78F2000569C64101F244AA20C0070D2A7FCB1939E19"
]
}
}
} }

最佳答案

@FormUrlEncoded
@POST("service_name")
void functionName(
@FieldMap Map<String, String> learning_objective_uuids, @FieldMap Map<String, String> user_uuids, @Field("note") String note,
Callback<CallBackClass> callback
);

更好的解决方案:使用 arraylist.. 引用链接:johnsonsu

@FormUrlEncoded
@POST("service_name")
void functionName(
@Field("learning_objective_uuids[]") ArrayList<String> learning_objective_uuids, @Field("user_uuids[]") ArrayList<String> user_uuids, @Field("note") String note,
Callback<CallBackClass> callback
);

关于android - 如何在改造android中发布数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37254232/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com