HttpUtils的简单使用

OkHttpUtils
        .get()//1.请求方式
        .url("http://192.168.2.234:8080/apps/categories.json")//2.url地址
        .build()//3.构件对象
        .execute(new StringCallback() {//执行请求
            @Override
            public void onError(Call call, Exception e, int id) {
                System.out.println("错误:" + e.getMessage());
            }

            @Override
            public void onResponse(String response, int id) {
                System.out.println("回复:" + response);
            }
        });
发布了33 篇原创文章 · 获赞 6 · 访问量 8万+

猜你喜欢

转载自blog.csdn.net/zlhyy666666/article/details/86991768