您的位置:首页 > 理论基础 > 计算机网络

HttpUtils

2016-03-29 21:16 507 查看
public void getJson(View v) {

HttpUtils httpUtils = new HttpUtils();

String path = "http://v.juhe.cn/weixin/query?key=0917c812f187b92e025c9b7c2d4e59b5&pno=2";

httpUtils.send(HttpMethod.GET, path, new RequestCallBack<String>() {

private ArrayList<MyList> list;

@Override

public void onFailure(HttpException arg0, String arg1) {

Toast.makeText(MainActivity.this, "请求失败", 0).show();

}

//请求成功

@Override

public void onSuccess(ResponseInfo<String> info) {

String result = info.result;

Gson gson = new Gson();

News news = gson.fromJson(result, News.class);

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: