HttpUtils

来源:互联网 发布:centos如何安装ssh 编辑:程序博客网 时间:2024/06/05 03:38
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);
          }
1 1
原创粉丝点击