LBase-Android框架是一款适合团队开发,代码层次鲜明的框架
// ... 网络请求地址,此URL来自于网络
String url = "http://www.duitang.com/album/1733789/masn/p/2/24/";
// ... 网络请求参数,默认为空
Map<String, String> params = new HashMap<String, String>();
params.put("key", "value");
// ... 网络请求编码方式,默认为UTF-8
LReqEncode encode = LReqEncode.UTF8;
// ... 网络请求方式,默认为Get,当请求参数不为空时,默认为Post
LReqMothed mothed = LReqMothed.POST;
// ... 网络请求提交的文件
List<LFileEntity> files = new ArrayList<LFileEntity>();
files.add(new LFileEntity("name", new File("uri"), LFileType.JPEG));
// ... 创建请求参数封装实体
LReqEntity entity = new LReqEntity();
entity.setUrl(url); // ... 设置地址
entity.setParams(params);// 设置参数
entity.setReqEncode(encode);// 设置编码方式
entity.setReqMode(mothed);// 设置请求方式
entity.setFileParamsList(files); // 设置所需要提交的文件集合
entity.setUseCache(false); // 设置请求是否启用缓存,默认为false
// 开始请求,传入请求参数实体,如果需要可以再设置请求ID
handler.startLoadingData(entity, 1);
String url = "http://www.duitang.com/album/1733789/masn/p/2/24/";
LReqEntity entity = new LReqEntity(url);
handler.startLoadingData(entity, 1);
throw new LLoginException()