更新时间:2022-06-12 22:48:09
您可以使用JsonElement
响应类型
@GET("xxx")
Call<JsonElement> groupList(@QueryMap Map<String, String> options);
您将收到的每个呼叫JsonElement
,您可以将其转换为JsonObject
或JsonArray
,甚至String
。您可以根据您的内容对其进行解析/取消具体化
public void onResponse(Call<JsonElement> call, Response<JsonElement> response) {
JsonElement jsonElement = response.body();
//JsonArray array = jsonElement.getAsJsonArray();
//JsonObject Obj = jsonElement .getAsJsonObject();
}