gpt4 book ai didi

android - Square 的改造客户端。可变数量的参数

转载 作者:搜寻专家 更新时间:2023-11-01 08:02:12 24 4
gpt4 key购买 nike

<分区>

我正在使用 Square 的 Retrofit 库。我需要使用可变数量的参数来实现请求。我找到了建议 ( link ) 并尝试这样做:

我改变

@GET("someURL")
void method(
@Query("firstParameter") int firstValue,
@Query("secondParameter") String secondValue,
Callback<Response> cb
);

@POST("someURL")
void method(
@Body Map<String, Object> parameters,
Callback<Response> cb
);

并使用跟随:

final HashMap<String, Object> param = new HashMap<String, Object>();
param.put("firstParameter", firstValue);
param.put("secondParameter", secondValue);

第一种方式很好用,第二种方式不行。怎么了?

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