参考: https://zybuluo.com/liter/note/187568 (1. 简单参数 HttpParamModel)
版本: lite-http-2.1.5.jar
继承HttpRichParamModel方式调试正常...
但是通过以下方式请求时, 发现日志中没有输出请求参数!!!
LiteHttp liteHttp = LiteHttp.newApacheHttpClient(null);
liteHttp.getConfig().setDebugged(true);
liteHttp.executeAsync(new JsonRequest(new Goods(1, 0), ApiModel.class));
//LOG
I/LiteHttp: lite http request: http://sgarss.com:8080/FruitLover/fruitlover/api/goods? , tag: null , method: Get , cache mode: null , thread ID: 7536 , thread name: lite-1
//param参数page和type没有输出...服务端也没有收到请求参数
/////////////////////////附加代码1
@HttpUri("http://sgarss.com:8080/FruitLover/fruitlover/api/goods")
public static class Goods implements HttpParamModel {
public Integer page;
public Integer type;
public Goods(Integer page, Integer type) {
this.page = page;
this.type = type;
}
}
//////////////////////附加代码2
public final class ApiModel {
public Integer stateCode;
public String message;
public String result;
public boolean isSuccess() {
return stateCode == 200;
}
}