HTTPUTILS获取网络数据
2016-07-01 08:28
411 查看
private void initEvent(final int i, String path1) {
HttpUtils httpUtils = new HttpUtils();
httpUtils.configCurrentHttpCacheExpiry(0);
HttpUtils httpUtils = new HttpUtils();
httpUtils.configCurrentHttpCacheExpiry(0);
httpUtils.send(HttpMethod.GET, path1, new RequestCallBack<String>() { @Override public void onFailure(HttpException arg0, String arg1) { } @Override public void onSuccess(ResponseInfo<String> arg0) { String result = arg0.result; try { ByteArrayInputStream stream = new ByteArrayInputStream( result.getBytes("utf-8")); List<Bean> listb = pullXml(stream); Message msg = new Message(); msg.obj = listb; msg.arg1 = i; handler.sendMessage(msg); } catch (Exception e) { e.printStackTrace(); } } }); }
相关文章推荐
- HttpClient、HttpUrlConnection请求数据的方式
- OkHttp Post请求方式
- Httputils请求数据Pull解析
- 写下几次坑爹的U盘装系统过程
- 转载 HTTP常见状态码分析 200 301 302 404 500
- 网络规划
- 网络规划
- http调试工具,linux调试工具
- http调试工具,linux调试工具
- 百度贴吧的网络爬虫(v0.4)源码及解析
- 百度贴吧的网络爬虫(v0.4)源码及解析
- 高性能网络开发库
- 高性能网络开发库
- 开源爬虫汇总表,83款 网络爬虫开源软件
- 开源爬虫汇总表,83款 网络爬虫开源软件
- 同网段和不同网段设备通信原理详解
- 无法将 Ethernet0 连接到虚拟网络"VMnet0" 详细信息可以在 vmware.log
- Asp.Net服务器发送HTTP标头后无法设置内容类型的问题解决
- Wrong03-App Transport Security has blocked a cleartext HTTP (http://) resource load since it is i
- 让Scrapy的Spider更通用